Hi.
I have a few lines of code that comprise of something like the following:
@@globalHeader@@
@@BitOfText@@
@@globalFooter@@
What I want to do is go through the lines above with ereg and weed out anything that has @@<whatever>@@ in it and put it into an array.
I've noticed that part of the ereg function is to put any matches into an array, which works out great for what I want, but whenever I use the function below
function elementReaderWriter($passIn) {
if (ereg("@@[a-zA-Z]*@@", $passIn, $passInMatches)) {
for ($x=0;$x<=count($passInMatches);$x++) {
print $passInMatches[$x];
}
}
}
I only get a return on @@globalHeader@@.
Am I missing something? I thought ereg looped through the text regardless?