Please consider this line of code:
$arr = array_filter(explode('/', $path), 'strlen');
and suppose $path variable is a url like:
$path = "http://localhost/oldcodes/test_codes/";
I expect the output of first code would be something like:
array(4) { [0]=> "5" [2]=> "9" [3]=> "8" [4]=> "10" }
because strlen function returns length of each string, BUT I get this result:
array(4) { [0]=> string(5) "http:" [2]=> string(9) "localhost" [3]=> string(8) "oldcodes" [4]=> string(10) "test_codes" }
could you please give me any hint why the result is in this way! Thanks