[PHP-DB] Re: String manipulation

2005-05-01 Thread Nadim Attari
http://www.php.net/manual/en/function.substr.php

Full String Documentation
http://www.php.net/manual/en/ref.strings.php

Regards,
Nadim

> Hi there everyone,
>
>
>
> I'm working with a mysql Db where I have a single string that I have to
> split into 2 strings, the first character is the first name and I have
that
> split off into it's own variable, but what I need to know is what's the
best
> method to read the string again BUT ignore the first letter as that is
> already copied into $firstname?  So basically I have $firstname defined
from
> the one string, but I have to define $lastname from the SAME string value
as
> the one I used for $firstname, BUT ignoring the first letter but I'm not
> sure what the best method is to achieve this?
>
>
>
> Any help would be very appreciated.
>
>
>
> Chris

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: string manipulation

2003-02-18 Thread Fredrik de Vibe
[EMAIL PROTECTED] (Martin Dziura) writes:
> is there some sort of parsing call i can evoke to extract the url?
> Beginning with the http and ending with the first white space?

$str = "foobarbazhttp://www.foo.bar/";;
preg_match("/(http:\/\/\S+)/", $str, $match);

$match[1] should contain the url part of $str. There are more
sophisticated regular expressions you can make for extracting url's,
but from your description, I think this should be enough.


-- 
--Fredrik
"Calvin Coolidge looks as if he had been weaned on a pickle."
-- Alice Roosevelt Longworth

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php