|
Posted by MattMika on 04/26/06 22:29
On Wed, 26 Apr 2006 12:53:26 -0500, "robert"
<ab@no.spam-alama-ding-dong> wrote:
>the key is the length of characters after the starting point...you're
>telling it to grab the next 43 characters that follow position 36. have a
>look:
Ahhh! I knew that, but wasnt paying ATTN. Here's what I came up with:
$string = "United Parcel Service (1 x 0.55lbs) (Ground):";
$start = strrpos($string, '(');
$end = strrpos($string, ')');
$span = ($end - $start);
$editstring = substr($string, ($start + 1), ($span - 1));
echo "<i>Edited String : </i>" . $editstring;
now it returns
Ground
Just like I wanted. Is there a more elegant way to do this?
Thanks robert,
Matt Mika
Navigation:
[Reply to this message]
|