select part of a word (rookie)
Posted: Thu Jun 12, 2008 5:46 pm
Howdy!
Warning! Totally rookie here.
I have a field in our member database, called 'latta'. it's values are usually
|||31--jan 21, 2008|||33--jan 22, 2008|||31--jan 24, 2008|||
I can grab this and explode it like this (I think, so far it worked):
My problem is that I need to print only the pieces that match '31%'. So using the above example, I would like to print only:
31--jan 21, 2008
31--jan 24, 2008
How can this be done?
On another note, is there a way to strip the '31--' parts before actually printing the results?
Thanks for any help, or pointers to samples dealing with something similar. Since I am not an actual php programmer (yet), I don't even know what to search for exactly for this problem.
Thanks again
David T.
Warning! Totally rookie here.
I have a field in our member database, called 'latta'. it's values are usually
|||31--jan 21, 2008|||33--jan 22, 2008|||31--jan 24, 2008|||
I can grab this and explode it like this (I think, so far it worked):
Code: Select all
$sql = mysql_query("SELECT * FROM wsnlinks_members WHERE latta LIKE '|||31%'");
$rowdetail = mysql_fetch_array($sql);
$data = $rowdetail['latta'];
$pieces = explode("|||", $data);
print $pieces[1];
print $pieces[2];
31--jan 21, 2008
31--jan 24, 2008
How can this be done?
On another note, is there a way to strip the '31--' parts before actually printing the results?
Thanks for any help, or pointers to samples dealing with something similar. Since I am not an actual php programmer (yet), I don't even know what to search for exactly for this problem.
Thanks again
David T.