Entry
How do u explode a string of content and then call each individual bit by it's own, new, variable???
Nov 24th, 2001 19:19
Brian Broadhead, jarrod nettles,
explode("seperator", $some_string);
Your original string must have a seperator.
Notice the seperator below is the colon (:)
This example saved 6 columns (fields) in a database.
Yes! The thought of a 1 column database did tempt me!!
$color_scheme = "1:008800:ffffff:000000:db7093:ffffff:bbddc6";
$split_color = explode(":", $color_scheme);
$button = $split_color[0];
$text1 = $split_color[1];
$text2 = $split_color[2];
$text3 = $split_color[3];
$table1 = $split_color[4];
$table2 = $split_color[5];
$bkground = $split_color[6];
Use eg. '$button' or '$split_color[0]' whatever suits you
Brian