|
Posted by misiek on 05/04/07 14:43
Hi
Problem to use
Works for all characters but not for - (dash).
when I use
eregi('[\=\+\-\]', 'te-xt')
return null
when I use
eregi('[\=\+\-]', 'te-xt')
return true
when I use
eregi('[\-\+\=\]', 'te-xt')
return null
Why its happening ?
Thanks for help
Basicly what I need todo is check in string if there is character to
repalce then replace
I was trying in preg_match and preg_replace but wired not working.....
This is sample how I need todo..
$characters = array['&',''','/','_','-']; in this array I need to store
this characters & ' / _ - ( not sure how to put single quote and
a slash)
foreach($characters as $character)
{
$pattern .= '\\'.$character;
}
$pattern .= '\\';
if (eregi($pattern, $string))
{
eregi_replace($pattern, '', $string)
}
thanks for help guys
[Back to original message]
|