Quote:
Originally Posted by m002.p
I was using the { } characters to enclose the variable as I have done in a mysql query for any variables like $array['offset'];
Do you not need to enclose variables? Is there documentation to understand when and when not to enclose in either ".$var['name']." or {$var['name']} ?
|
Oh right, I was getting confused. You do sometimes need those like you said (and they don't hurt even if you don't technically need them - although I think you did need them, like you said). So you would want to take them out of my example since the variable isn't directly in the string any more.
Quote:
I thought \b meant exact word search? So for example "I have a string" passed through preg_match with this \b searching for "in" would be false, whereas without the \b it would be true?
|
That's pretty much the idea, yeah. Sorry, I wasn't sure how much you knew about it. Sometimes people just copy stuff from somewhere else and don't really understand it.
Quote:
Lastly what is the syntax for the above preg_quote example you provided without the \b?
Code:
if (preg_match('/' . preg_quote($player['name'], '/') . '/', $ctag))
?
|
That looks right.