You are here: find characters eregi() « PHP Language « IT news, forums, messages
find characters eregi()

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация