can i shorten some php like this?

Soldato
Joined
19 Oct 2002
Posts
3,480
quick question: can i use something similar to this shortened code:

Code:
if (strpos($fname, "p.jpg"|"t.jpg") > 0){

or does it have to be more like:

Code:
if ((strpos($fname, "p.jpg") > 0) | (strpos($fname, "t.jpg") > 0){
?

funny thing is the first one seems to work but only acknowledges the filenames ending in t not p :confused:
 
all very good to know :)

the regex method above worked great :) could you tell me the purpose of the slashes either side of the expression?

/p.jpg|t.jpg/i
 
Back
Top Bottom