Hello friends and seniors over there...
Here's my prob ..searching for the solution..
i had made a table for marks obtained by student called "tb_score" with fields like
score_id,st_id,exam_type,sub_id_set,mo_set,remarks_set,percentage,result .
In fields like sub_id_set,mo_set,remarks_set i had inserted the values separated by comma for EX: ",value1,value2,value3 etc."
I am getting prob in retrieving the values separated by comma....can anybody help me in retrieving the values separated by comma with a bit code.....
Thanks in advance
how to separate the values separated by "," ???
Moderator: General Moderators
Untested...
Code: Select all
$valuesArray = explode(',', $commaDelimitedValues);
foreach ($valuesArray as $value) {
echo $value;
}- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
See if strpos() can help.
substr_replace() should do the job
Code: Select all
$values = ',value1,value2,value3';
echo substr_replace( $values, '', 0, 1 );