Hello guys.
I need a little help with regular expression again.
[B]Problem:
I have a string containing $ on several places in it. The string is actualy a text file loaded, so any word starting in the text file with $ is beng considered as a text not variable.
[B]Question:
How to obtain the list of all the words which start with $ in the string.
e.g.
[B]The text file contents are:
[COLOR=Teal]
My name is $thename
My age is $theage
[B]PHP script loading the file:
[COLOR=Blue]$myvar = implode(”,file(‘myfile.txt’));
And what I need is:
[COLOR=DarkRed]$list = list_dollar_words($myvar);
[COLOR=DarkSlateGray]//which must return an array of words starting with $ sign.
//means it must return array of two elements when having data of above
//text file:
//Array( [0] => $thename, [1] => $theage)
I hope I explained enough.
will be waiting for kind reply.
regards