Re: string questions
| From: | Richard Lynch | Date: | Mon, 05 Aug 2002 06:03:06 +0000 |
| Subject: | Re: string questions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111158@lists.php.net to get a copy of this message | ||
>I know there has to be an easy way to do this, but I just can't find the
>answer. I need to strip out the first part of a text string. I've
>figured out out to strip out the last part of a string using the
>following:
>
>$address = (4455 N. 45th St.);
>
>$test = strstr($address, " ");
>echo $test;
>
>The variable $test returns N. 45th St. without the 4455. Is there a way
>to reverse this so I can just return 4455?
$position = strpos(' ', $address); # Or is it strpos($address, ' '); ?
$number = substr($address, 0, $position);
http://php.net/strpos
http://php.net/substr
WARNING:
There *ARE* addresses like:
'324 1/2 West Main Street'
out in the real world...
Or even '221 B Baker Street' :-)
--
Like Music? http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro). Need to record live events (mixed already) to stereo
CD-quality. Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff. Zero (0)
post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.