Re: Splitting a string
| From: | - Edwin | Date: | Thu, 13 Mar 2003 14:30:22 +0000 |
| Subject: | Re: Splitting a string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139503@lists.php.net to get a copy of this message | ||
Hi,
"Christopher J. Crane" <ccrane@ikon.com> wrote:
[snip]
> If that number start with a "S", I want to strip it off.
[/snip]
Why don't you just check whether the first character is an "S" then
return only the rest of the string if it is? Like:
<?php
$my_string = 'S12345';
if ($my_string{0} == 'S'){
$rest_of_the_string = substr($my_string, 1);
}
echo $rest_of_the_string;
?>
Of course, there could be some other way...
- E
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/