PHP print, print_r, printf

print is similiar to echo, it print out string on the screen. Similarly, when double quotes are used, variable's value will be print out, while single quotes will print out the variable name only.

	print "PHP Tutorial"; //PHP Tutorial
	print 'PHP Tutorial'; //PHP Tutorial
	print "$a PHP Tutorial"; //Joni PHP Tutorial
	print '$a PHP Tutorial'; //$a PHP Tutorial

Special characters include double quote, single quote should be escaped using \ symbol. Strings can be concatenated using symbol while printing.
	print "John's daughter";  //John's daughter
	print 'John\'s daughter';  //John's daughter
	print 'John"s daughter';  //John"s daughter
	print "John\"s daughter";  //John"s daughter
	$arr = array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
	   print $i . " is: " . $arr[$i-1] . ".";
	1 is: Monday.
	2 is: Tuesday.
	3 is: Wednesday.
	4 is: Thursday.
	5 is: Friday.
	6 is: Saturday.
	7 is: Sunday.

print can not use heredoc symbol <<<. It always return value 1.

print_r() function provides a convenient way to print out a varaible's value, including string, number, array, objects etc.
	print_r($a);  //4
	$b="This is a string";  
	print_r($b);  //This is a string
	$arr = array("Monday","Tuesday","Wednesday","Thusday","Friday","Saturday","Sunday");
	//Array ( [0] => Monday [1] => Tuesday [2] => Wednesday [3] => Thusday [4] => Friday [5] => Saturday [6] => Sunday ) 
	//Array ( [0] => Monday [1] => Tuesday [2] => Wednesday [4] => Friday [5] => Saturday [6] => Sunday ) 

var_dump() function is similiar to print_r().

printf() function formats string and then prints out on the screen. sprintf() function formats string and returns the string.
	printf("%e",$a); //3.340000e+4
	printf("%b",$a); //1000001001111000
	printf("%b in scientific format is %e",$a,$a); //33400 in scientific fomrat is 3.340000e+4
	$s=sprintf("%b in scientific format is %e",$a,$a);
    echo "$s"; //33400 in scientific fomrat is 3.340000e+4

printf() format specifiers:
%cASCII character
%dsigned decimal number
%escientific number
%uunsigned decimal number
%ffloat with local settings
%Ffloat without local settings
%ooctal number
%xlowercase hexadecimal
%Xuppercase hexadecimal