Two ways:

1.      $string = preg_replace("^.{1}", 'h', 'bill');   // will make
'h'ill out of 'b'ill
2.      $string = 'h'.substr('bill', 1);                        // will
get rid of the first char and concatenate



Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins




-----Original Message-----
From: Diana Castillo [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, April 24, 2002 6:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] replacing first occurence


What function can I use to replace just the first occurence of a "," in
a string? Thank you



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



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

Reply via email to