On Thursday 29 March 2001 22:38, you wrote:
> H-
>
> Thanks to those that emailed.
>
> $query = "tree, bird, nest, ";
> $new = substr($query,0,2);
>
> Doesn't seem to work. It returns "tr".

$new = substr ($query, 0, strlen ($query) - 2);

or
$new = preg_replace ('/,.*?$/', '', $query);

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"World domination. Fast." (Linus Torvalds about Linux)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to