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
-1
votes
2 answers

Trimming array values

I know var_dump($array) trims the array content & print it. but I want to skip the print part. What should I do? Should I use some other function
infinityskyline
  • 369
  • 2
  • 4
  • 17
-1
votes
1 answer

How interpret Simple XML to HTML with PHP?

I get response from the server in Simple XML, but I want get to my page only data I need and show this data in html tags. How I can do it? My request code: include "TopSdk.php"; date_default_timezone_set('Asia/Shanghai'); $c = new…
WSP Web
  • 5
  • 3
-1
votes
2 answers

$_SESSION variable not setting value

[RESOLVED] In my login.php, several $_SESSION variables are set. I've recently added in another = $_SESSION['darkM'] = false;. Doing a var_dump($_SESSION); (Results below), my other variable's values are set perfectly but this one just will…
user14171693
-1
votes
2 answers

PHP: displaying NULL but actually contains data

product table structure is given below CREATE TABLE `products` ( `id` int(6) unsigned NOT NULL AUTO_INCREMENT, `category_id` int(6) unsigned NOT NULL, `name` varchar(30) NOT NULL, `unit_id` int(6) unsigned NOT NULL, `brand_id` int(6)…
Rana
  • 7
  • 4
-1
votes
1 answer

How to use Symfony Vardumper to avoid displaying relationships

How to use Symfony Vardumper to avoid displaying relationships Is is possible that even when the relationships are there avoiding to display those relationships? with a limiter or something? Thanks you. Been searching for this for a while
-1
votes
1 answer

How to convert a nested JSON array in PHP

I need to convert h this JSON: ["theory",["theory","theory of relativity","theory test","theory of everything","theory definition","theory of evolution","theory of mind","theory of a deadman","theory of love","theory meaning"]] to a array,…
-1
votes
1 answer

Unexpected output when using var_dump() over GLOBALS array in PHP

I have this code: I am having the following output, can anyone help me to understand what does that output mean: array(7) { ["_GET"]=> array(1)…
Sumit Singh
  • 487
  • 5
  • 19
-1
votes
1 answer

I have an result JSON, then i see the output with var_demp, but it not show full result

Here is my output. See end of line. The output just gives me '...'. public 'results' => array (size=1) 0 => object(..)[18] ... And this is my code to debug the…
Rahma TV
  • 49
  • 4
-1
votes
3 answers

var_dump outputting string('**') "array"

I am using a foreach loop and a var_dump but the var_dump from the following code outputs something strange. How do I get rid of the pre-prended sring() and quotation marks? $dir = 'url/dir/dir/'; $images_array = glob($dir.'*.jpg'); $images =…
theorise
  • 7,245
  • 14
  • 46
  • 65
-1
votes
2 answers

How to re-use fetched data in php

I get data from exchanges, but they have a rate limit, means I cannot fetch the data too often. However, during programming I would like to start at the point where I had already the data. The last line of the fetched code is just a var_dump. How…
Ronald Wiplinger
  • 2,033
  • 3
  • 14
  • 20
-1
votes
1 answer

Why is my var_dump() only showing when used outside of the function?

I'm learning about var_dump() while trying to debug some code in my WordPress functions.php file. When var_dump() is used inside a function it does not display on the page. Nothing will display with this: function my_function() { $test_variable…
TinyTiger
  • 1,801
  • 7
  • 47
  • 92
-1
votes
2 answers

Why Am I Getting an Undefined Index Error When var_dump($_POST) Shows an Array?

I have a form that is posting data to a PHP page on the same local site. I know that data is posting correctly because var_dump($_POST) outputs an array with the expected information, as shown below. However, when I try to set a variable to one of…
dpayne
  • 273
  • 3
  • 14
-1
votes
2 answers

Display value of Array

I have this function : $array = $um_followers->api->following( $currentid ); If I tried a var_dump : var_dump($um_followers->api->following( $currentid )); This is the result : array(2) { [0]=> array(1) { ["user_id1"]=> string(1) "1" } [1]=>…
Mathieu
  • 797
  • 2
  • 6
  • 24
-1
votes
1 answer

Have not access to the element of object without var_dump at front

I'm having a very strange problem. The thing is, that I can't access anything from the variable $conDat["_RenewalDate1"] unless I use an var_dump of it upfront. With this code: var_dump($conDat["_RenewalDate1"]); $test = $conDat["_RenewalDate1"] ->…
-1
votes
1 answer

If and Else If Progress Bar

Below is a simple progress bar module I'm trying to create. progress 2"; var_dump($progress); echo "
"; $progressPrint = "
user3135730
  • 320
  • 1
  • 3
  • 8