?>
string basename(string path)
The basename function returns only the filename part of a path. Directories are
understood to be strings of numbers and letters separated by slash characters (/). When
running on Windows, backslashes () are used as well. The flip side to this function is
dirname, which returns the directory.
<?
$path="/usr/local/bin/ls";
print(basename($path));
?>
string bin2hex(string data)
The bin2hex function returns the data argument with each byte replaced by its
hexadecimal representation. The numbers are returned in little-endian style. That is, the
first digit is most significant.
<?
//print book title in hex
//436f7265205048502050726f6772616d6d696e67
$s = "Core PHP Programming";
$s = bin2hex($s);
print($s);
?>
string chop(string text)
The chop function returns the text argument with any trailing whitespace removed. If
you wish to remove both trailing and leading whitespace, use the trim function. If you
wish to remove leading whitespace only, use ltrim. Whitespace includes spaces, tabs,
and other nonprintable characters, including nulls (ASCII 0).
<?
print("\" ".
chop("This has whitespace ").