Questions tagged [var-dump]

var_dump is a PHP function that dumps information about a variable.

var_dump is a PHP function that dumps information about a variable.

Examples

$a=array(1,2,3);
var_dump($a);
$b="hello so";
var_dump($b);

returns

array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) }
string(8) "hello so"

References

332 questions
0
votes
2 answers

PHP: IF sentence is run, but dumps says it shouldn't

im sitting with a pretty simple image uploader, where the first image uploaded is going to be treated in a special manner. I then run a loop over all the files, and skip the first image. For this i have named the first image headImage, and i skip it…
DalekSall
  • 385
  • 1
  • 2
  • 12
0
votes
1 answer

xDebug: What's the number included in var_dump?

If you're using xDebug with PHP and var_dump an object, you'll see output something like this object(Example)[176] That is, var_dump will show you the variable is an object, that its class is Example, and -- then there's the number. In the above…
Alana Storm
  • 164,128
  • 91
  • 395
  • 599
0
votes
1 answer

var_dump for DOMNodeList printout unexpected result

I have a xml file I load it as the following: //$file the file system path of the xml file function getTopicsList($file){ $doc = new DOMDocument(); $doc->load( $file ); var_dump($doc->getElementsByTagName('topic')); …
SaidbakR
  • 13,303
  • 20
  • 101
  • 195
0
votes
1 answer

Var_dump return null...why?

Good Morning, I work with zend framework (php) and I see in var_dump the value of an option to a select after I send a POST request. code :
0
votes
1 answer

Yii posting data to controller turns up empty

Explanation I have a plain HTML form with a few fields I post it to my controller function In the function I var_dump the POST data public function actionReceive() { echo "
";
    var_dump($_POST);
    echo "
"; exit(); } On…
Bob van Ham
  • 125
  • 5
0
votes
2 answers

var_dump() returns NULL somehow

I made a function to validate the e-mail address to vaidate and check if they are matched or not. But it doesn't seem to work because when I var_dump(). I got the null value such as: NULL string(13) 123@gmail.com. Could you give me some advice to…
Toshi
  • 6,012
  • 8
  • 35
  • 58
0
votes
1 answer

Strange broken var_dump loop ends with ... string (#)

 $nbsp;&nbs"... string(8) "result 2" This is part of the result from a var_dumped $result generated from fetched sql query. I simply wonder what is the specific meaning of "..." when it suppose to keep generating more $nbsp; and one more…
ey dee ey em
  • 7,991
  • 14
  • 65
  • 121
0
votes
3 answers

PHP array value isn't shown by var_dump but it was fetched.

I wrote some program to check the value in an array. var_dump($profileuser);//NULL $profileuser = get_user_to_edit($user_id);//fetch the value of $profileuser var_dump($profileuser);//does not print the value of $profileuser->user_url //nor by…
Ray
  • 568
  • 6
  • 20
0
votes
1 answer

PHP post with square brackets not creating array

I have used square brackets in forms a few times, however im stumped as the one i'm working on now using Twitter BootStrap (would that make any difference?) is not sending the data(!) - 12 yrs coding and now i'm asking this silly q. What i could…
FstaRocka
  • 278
  • 1
  • 2
  • 15
0
votes
1 answer

var_dump prints to screen before prepended elements

Why does PHP's var_dump() print fist when I make it the second element of a concatenated string? echo "log_files: " . var_dump($log_files); => array (size=4) 0 => string '.' (length=1) 1 => string '..' (length=2) 2 => string…
1252748
  • 14,597
  • 32
  • 109
  • 229
0
votes
1 answer

Unexpected output of var_dump when string contains html

I have an if statement that looks like this: if($benchmark_one_name2 === "Russell 1000 Index"){ $benchmark_one_name2 = "Russell 1000 Index"; var_dump("this if statement is…
Andrew Font
  • 1,245
  • 3
  • 19
  • 38
0
votes
2 answers

vardump don't work correctly in CI

My controller: function search() { $this->load->model('membership_model'); $this->membership_model->search(); } Model: function search() { $q = $this->db->get('feeds'); var_dump($q); } Why var_dump it…
user3313651
  • 105
  • 1
  • 1
  • 8
0
votes
1 answer

array radio button for quiz

i have created a quiz format like QCM examen first i used radio button only and the problem of this radio button must have a name with the id of the question and the value must be the id of the answer example : the php code (using while)
Mulham Aryan
  • 23
  • 1
  • 5
0
votes
1 answer

Illegal string offset 'properties', how to pass json encoded values

how do I assign a field of a json_encoded result to a variable. I have the following: $jsonres = json_encode($result); //where result is an array holding fields including name (string), properties (object type or array) I tried the following: echo…
Kingsley
  • 183
  • 1
  • 15
0
votes
1 answer

How to parse a nested json array in CI

i am trying to parse the following json { "offerinfo": { "offername": "chaos", "offertype": "3", "brand": "1", "subbrand": "0", "categories": "1,2", "Tags": "4,6", "promotiontype": "1", "currency": "1", …
Ramaraju.d
  • 1,301
  • 6
  • 26
  • 46