Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

preg_match_all function

Status
Not open for further replies.

likelylad

IS-IT--Management
Jul 4, 2002
388
GB
What is wrong with the following line of code

$findmatch=preg_match_all("/a/",$contents);

I am trying to find if the letter a exists in the variable $contents.

I will then use the subsequent array to count how many times it counted
 
OK, don't really understand the notes.

What I would like to do is search a string that may contain one of a pre-specified group of characters.

eg in a string I may want to find a or b or c

 
I have gotten the following to work for me

eregi("[À-ÖØ-öø-ÿ]",$splitfile,$reg)

but how do I count all characters in that range????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top