Hi,
I have a variable $var which contains a delimeter "|"
I need to get rid of everything after and including the "|"
Is this possible?
you can use strtok to do this:
<?PHP $string = strtok($string, "|"); ?>
Thomas
or
<?php $string = "Hello|World"; $str_ary = explode($string,'|'); echo $str_ary[0]; ?>
prints Hello
Actually drawmack, when using explode(), the delimiter comes before the string....
<?php $string = "Hello|World"; $str_ary = explode('|',$string); echo $str_ary[0]; ?>
opps that'll teach me not to look up functions.
Yeah, that stupid manual.... What happened to the stuff in your noggin'? You falling apart or what? LOL. Ahh, it's Sunday. It's all good! You all have a nice remainder of your weekend.