ok on this site, http://php.net/manual/en/function.basename.php
I found in description
string basename ( string $path [, string $suffix ] )
In example
my question is (I hope not a silly one) why in the description the the square brackets started before the comma I expect it to bePHP Code:<?php
echo "1) ".basename("/etc/sudoers.d", ".d").PHP_EOL;
echo "2) ".basename("/etc/passwd").PHP_EOL;
echo "3) ".basename("/etc/").PHP_EOL;
echo "4) ".basename(".").PHP_EOL;
echo "5) ".basename("/");
?>
string basename ( string $path, [string $suffix ] )
and not
string basename ( string $path [, string $suffix ] )
I find php.net not user friendly for newbies.




Reply With Quote

Bookmarks