Page 1 of 1

Searching an expression using regular expressions.

Posted: Mon Oct 22, 2007 6:59 am
by jak82
Hey there,

I am trying to find the element of an array which has .php in

Code: Select all

$chars =split("/", $_SERVER['PHP_SELF'], 5);
$cj = in_array(".php", $chars);

print_r($chars);
echo $cj;
The problem is $cj = nothing. Im guessing this is because it looks for an exact match.
How can I use regular expressions to search for the element with anything .php .

Chris

doesnt matter

Posted: Mon Oct 22, 2007 7:18 am
by jak82
Foudn anothe rfunction which dioes it for you..

Basename

J