hello all,
here is a preg_match routine that i am using. basically, $image is set in
some
code above, and it can be either st-1.gif or sb-1.gif (actually it randomly
picks
them from about 100 gifs).
then it processes them based off of which image type it selected, either the
st- 's or
the sb- 's.
problem is, the preg_match that i have seems to only see the 's' then
assumes that it
"matched". if i leave the code in the order you see below, any "s" gif
matches as "sb-",
if i rearrange the code so that the preg_match "st-" is first, then any "s"
gif file matches
as "st-".
if (preg_match('`^[sb-]+.*(gif|jpg)$`' ,$image)) {
blah blah blah
}
elseif (preg_match('`^[st-]+.*(gif|jpg)$`' ,$image)) {
blah blah blah
}
here is a preg_match routine that i am using. basically, $image is set in
some
code above, and it can be either st-1.gif or sb-1.gif (actually it randomly
picks
them from about 100 gifs).
then it processes them based off of which image type it selected, either the
st- 's or
the sb- 's.
problem is, the preg_match that i have seems to only see the 's' then
assumes that it
"matched". if i leave the code in the order you see below, any "s" gif
matches as "sb-",
if i rearrange the code so that the preg_match "st-" is first, then any "s"
gif file matches
as "st-".
if (preg_match('`^[sb-]+.*(gif|jpg)$`' ,$image)) {
blah blah blah
}
elseif (preg_match('`^[st-]+.*(gif|jpg)$`' ,$image)) {
blah blah blah
}
Comment