Jump to content


Breaking a string into an array

  • Please log in to reply
1 reply to this topic

#1 gerkintrigg

  • Members
  • PipPipPip
  • Magician
  • 828 posts
  • LocationBristol, UK
  • Age:37

Posted 27 August 2006 - 10:23 AM

Hello everyone.

I'm trying to split a string into different parts. The sring looks like this:


I then want to use this string to query the database using the first number (41) and then loop through the other numbers (70, 63 and 219) to get the associated values from another datbase.

After the first number, there may or may not be any amount of numbers. I know to use the : as a seperator, but not sure of the function to use.

Please help.

Thanks in advance.
Neil Trigger - http://www.ghostlypublishing.co.uk - Ghostly Publishing - Children's Fantasy Books

#2 shocker-z

  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 27 August 2006 - 10:34 AM


now it is held in an array and just use count($explode); to see how many values there are or loop thru with foreach ($explode as $value) { }

www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users