![]() |
|
|
+ Search |
![]()
|
Dec 1st, 2003 14:08
Jakub Vrana, John Hunter, Ben Udall,
I think that there's no word-boundaries support in ereg functions, so
you have to use preg_replace.
<?php
echo preg_replace("/\\band\\b/", "or", "sand and and");
// prints: sand or or
?>
\b stands for word-boundary in PCRE (Perl compatible regexp) functions.