if I have the following string: Half Moon Bay, CA 941234
How can I return everything from the , back, meaning I just want to return Half Moon Bay.
I am using substr to pull just the state and zip as they are constant lengths, however a city obviously is not.
All help appreciated.
Rgds
Darren
strchr(',') will return the position of the first comma, which you can use in substr
$where = substr($oldstr, 0, strchr(','));
try it and let me know if it works
jason
Hi!!! This code maybe works:
ereg("([[:word:]]+),", $string, $aux);
and in $aux[1] yo'll have the following:
Half Moon Bay
HTH
inK