Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,870 questions

51,793 answers

573 users

How to dump information about a variable in PHP

2 Answers

0 votes
$a = array(1, 2, 3, 4, array("x", "y", "hi"));
echo "<pre>";
var_dump($a);
echo "</pre>";
 

/*
run: 

array(5) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
  [3]=>
  int(4)
  [4]=>
  array(3) {
    [0]=>
    string(1) "x"
    [1]=>
    string(1) "y"
    [2]=>
    string(2) "hi"
  }
}

*/

 



answered Jul 22, 2016 by avibootz
0 votes
// void var_dump( mixed $expression [, mixed $... ])

$n = 100;
$f = 3.14;
$l = 100000000000067888888888888888888888889;
$t = true;

echo "<pre>";
var_dump($n, $f, $l, $d, $t);
echo "</pre>";
 

/*
run: 

int(100)
float(3.14)
float(1.0000000000007E+38)
bool(true)

*/

 



answered Jul 22, 2016 by avibootz

Related questions

1 answer 210 views
1 answer 182 views
1 answer 174 views
1 answer 209 views
...