Monday, 1 December 2014

Strtolower - Returns string with all alphabetic characters converted to lowercase

string strtolower ( string $str )
Make a string lowercase
Returns string with all alphabetic characters converted to lowercase.

<?php
$str 
"Mary Had A Little Lamb and She LOVED It So";$str strtolower($str);
echo 
$str// Prints mary had a little lamb and she loved it so?>


14.-Curso PHP-MySQL. Formatear, cortar y unir strings.

Sunday, 30 November 2014

PHP file_get_contents Function - Reads entire file into a string

string file_get_contents ( string $filename [, bool $use_include_path = false [, resource $context [, int $offset = -1 [, int $maxlen ]]]] )
Reads entire file into a string
This function is similar to file(), except that file_get_contents() returns the file in a string, starting at the specified offset up to maxlen bytes. On failure, file_get_contents() will return FALSE.

<?php
$homepage 
file_get_contents('http://www.example.com/');
echo 
$homepage;?>

5.1.0 Added the offset and maxlen parameters. 5.0.0 Added context support.

PHP mail attachment - sending an attachment with PHP