Need code for seperating data from database
Posted: Wed Jan 13, 2010 8:21 am
hi
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
is this how the code is within your database?smartsambath wrote:hi...
i need a php code that extract the following data
#*1582*TN_reg*12.30*3232*name*id*454*3545*#
Code: Select all
$string = "1582*TN_reg*12.30*3232*name*id*454*3545";
$stuff = explode("*",$string);Code: Select all
echo $stuff[0]; // = "1582"
echo $stuff[1]; // = "TN_reg"Code: Select all
#*1582*TN_reg*12.30*3232*name*id*454*3545*#Code: Select all
$string = str_replace('#','',$string); // to remove hashes
$string = substr($string, 1, strlen($string)); // to remove first *