From 0ebc0b5f069ffcd74b8b1bec948dd408898f6d0e Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Sat, 19 Feb 2000 01:49:29 +0000 Subject: [PATCH] Added function examples for: touch, strtolower and strstr git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@19919 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/filesystem.xml | 10 ++++++++++ functions/strings.xml | 17 ++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/functions/filesystem.xml b/functions/filesystem.xml index 4cb44d6c47..06c497360d 100644 --- a/functions/filesystem.xml +++ b/functions/filesystem.xml @@ -1913,6 +1913,16 @@ $tmpfname = tempnam ("/tmp", "FOO"); Returns true on success and false otherwise. + + <function>touch</function> example + +if ( touch($FileName) ) { + print "$FileName modification time has been changed to todays date and time"; +} else { + print "Sorry Could Not change modification time of $FileName"; +} + + diff --git a/functions/strings.xml b/functions/strings.xml index 75cf19b4fb..eda334f820 100644 --- a/functions/strings.xml +++ b/functions/strings.xml @@ -1771,7 +1771,16 @@ echo str_repeat("-=", 10); If needle is not found, returns false. If needle is not a string, it is converted - to an integer and applied as the ordinal value of a character. + to an integer and applied as the ordinal value of a character. + + <function>strstr</function> example + + $email = 'sterling@designmultimedia.com'; + $domain = strstr($email, '@'); + print $domain; // prints designmultimedia.com + + + See also stristr, strrchr, substr, and @@ -1843,6 +1852,12 @@ echo str_repeat("-=", 10); Note that 'alphabetic' is determined by the current locale. This means that in i.e. the default "C" locale, characters such as umlaut-A (Ä) will not be converted. + + <function>strtolower</function> example + + $str = "Mary Had A Little Lamb and She LOVED It So"; + $str = strtolower($str); + print $str; # Prints mary had a little lamb and she loved it so See also strtoupper and ucfirst.