PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Here is my problem im sure its just a syntax problem but if anyone cuold help that would be greatly appreciated.
here is my line of code
if (ereg('^($searchvar).*X*[SML]$',$row['Sku'])) ( >rest of code
The problem is the variavle $searchvar is not bieng passed into the argument (or at least i think so). $searchvar is text ie r2-1001.
if i replace $searchvar with my txt string it works fine but not with the variable in there.. mmm any ideas...
if (ereg('^($searchvar).*X*[SML]$',$row['Sku']))
^
what's . doing in here it should be \. should not it? I'm not sure but I recall a tutorial saying . should be excaped. And also I think this helps, ereg("^($searchvar)[\.]*[X]*[SML]$",$row['Sku']).