Im trying to figure out the syntax for a regular expression using eregi in which i will have to search for speical charecters.
For instance. I will need to search for &# which is used in diplaynig a degree sign in html. I know that a will seach the letter a but i tried a & or a #* and nonthing worked.
Any help would be great. Ira
$file = fopen("http://www.whatever.com/whatever.html", "r"); $rf = fread($file, 2000000); $grab = eregi("<b>(.*)</b>", $rf, $printing);
echo $printing[0]; prints out anything between the <b> and </b>
not sure if this will help but thought i'd post it anyway
Rgds
D
eregi('[&]{1,}', $amp);
$amp[0] will return the matched string.
[&] means to look for & sign. and {1,} says, that it can be 1 or more of these signs. if you do {1,5} then it means, & can appear 1 to 5 times.
sorry, try again
$file = fopen("http://www.whatever.com/whatever.eml", "r"); $rf = fread($file, 2000000); $grab = eregi("<b>(.*)</b>", $rf, $printing);
sorry typo: should be: eregi('[&]{1,}', $string, $amp);