Difference between print_r() and var_dump(): 
In this article, I will explain difference between print_r(), var_dump() and var_export().

var_dump():
The var_dump function displays structured information about variables/expressions that includes its type and value

Syntax
var_dump(variable1, variabl2, ....)

Example:
<?php
$str = array(1, 2, "a");
var_dump($str);
?>
OUTPUT:
array(3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
string(1) "a"
}

print_r() :
displays human-readable information about a variable
Example:
<?php
$arr = array ('a' => 'blue', 'b' => 'Red', 'c' => 'Green');
print_r ($arr);
?>
Output:
Array
(
    [a] => blue
    [b] => Red
    [c] => Green


)