Author Topic: Help with some simple php  (Read 545 times)

0 Members and 1 Guest are viewing this topic.

Offline Underdog

  • New Member
  • *
  • Posts: 98
  • Karma: 476
  • Gender: Male
  • SMF/Games Helper
    • Ask Us A Question
  • SMF Version: 2.0 Rc1.2
Help with some simple php
« on: February 19, 2010, 02:14:29 PM »

I have been stuck trying to accomplish a small task for a project I'm working on, involving fetching some specific info from a string..

I have tried messing with 'explode', 'preg_split', etc.. and I can't seem to get the results I need.

Within a variable is basically a whole bit of php for displaying pictures in a table (with rows, etc..).
I want to split the variable into an array and each part of the array should contain a url beginning with certain characters from the original variable..
ie..
$boardurl.'/mgal_data/albums/'

... but it should stop feeding the array with characters when it hits the next quotation inside that variable which would be the end of that specific url in that part of the array.
(The original variable may contain several urls and I would like it to feed them all into the array.)
Hopefully I explained this clearly enough.

Thanks.

UD
« Last Edit: February 20, 2010, 02:15:10 PM by bigguy »

Offline Underdog

  • New Member
  • *
  • Posts: 98
  • Karma: 476
  • Gender: Male
  • SMF/Games Helper
    • Ask Us A Question
  • SMF Version: 2.0 Rc1.2
Re: Help with some simple php
« Reply #1 on: February 20, 2010, 04:03:46 AM »

Nevermind...

I didn't figure out how to do what I asked but I did solve my issue in a more proper manner.

I figured out the proper way to query the db for the info I needed.

For future reference it would be nice to know how to do what I asked anyway!?


UD

Offline bigguy

  • Site Owner
  • Administrator
  • *
  • Posts: 13225
  • Karma: 269
  • Gender: Male
  • Get'r Done
    • P.C. Tweakr
  • SMF Version: 2.0 Gold
Re: Help with some simple php
« Reply #2 on: February 20, 2010, 02:15:20 PM »
Glad you got it solved. :)

Offline ccbtimewiz

  • Dreamer
  • Guru
  • *
  • Posts: 1304
  • Karma: 2100
  • Gender: Male
  • $info->close();
    • Dream Portal
  • SMF Version: SMF 2.0 RC4
Re: Help with some simple php
« Reply #3 on: February 20, 2010, 02:47:13 PM »
You were looking for implode() by the way.