Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

PHP not echoing variables when print_r does

<?php

$_POST = array(
'selectCountries' => array('Columbia'),
'startDate' => '2001-01-01',
'minAcres' => 0
);
print_r($_POST);

$x = $_POST['minAcres'];
echo $x;

?>
  
//Output

Array
(
[selectCountries] => Array
    (
        [0] => Columbia
    )

[startDate] => 2001-01-01
[minAcres] => 0
)
0
  
//syntax error

$x = $_POST['minAcres'];
 
PREVIOUS NEXT
Tagged: #PHP #echoing #variables
ADD COMMENT
Topic
Name
3+8 =