Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
July 28, 2006, 10:48 pm
rate this thread
$mystring = "67,11,68,11,69,11,70,11"; // comes from a varchar MySQL field
I wish that
$myarray = array($mystring);
would work, but it doesn't seem to.
I've tried every angle of string evaluation I can think of...but not the one
that works. I've considered iterating through the string character by character
and extracting each numeric substr, but it must be simpler than that.
Any and all advice will be appreciated.
Re: Population array from string of comma separated numbers?
Not everything needs to be normalized. If those numbers are never
searched on individually or linked to anything else in the database,
there's no point taking on all the overhead (in programming and storage
space) to create a separate table and join them.
Photos from 40 countries on 5 continents: http://travel.u.nu
Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
Airports of the world: http://airport.u.nu