echo and (var_dump or print_r) showing completely different things on laravel object
By : user3382092
Date : March 29 2020, 07:55 AM
should help you out I have this code in laravel: , In Laravel 5 you should use dd, e.g.: code :
dd($links);
{{ dd($links) }}
|
Cant echo a string in multidimensional array but can print_r
By : José Manuel Badia
Date : March 29 2020, 07:55 AM
will help you Looks closer at your print_r($_SESSION['userdata']);. It's an array inside of an array. So you're not going deep enough to reach your values. code :
echo "You are currently logged in as: " . $_SESSION['userdata'][0]['username'] . "<br>";
|
echo json_encode is conflicting with print_r and echo in php
By : rezaa rezaa
Date : March 29 2020, 07:55 AM
hop of those help? Simply don't output debug messages into your data. Of course that will break your data. Use error_log, syslog, or something like a plain file_put_contents('debug.log', var_export($foo, true), FILE_APPEND) to output debug data to a log file instead.
|
how to echo print_r() array output
By : none
Date : March 29 2020, 07:55 AM
will be helpful for those in need Loop the array like shown below. The key is the email, then use implode() on the value code :
foreach ($array as $key => $value) {
echo "key: " , $key , PHP_EOL;
echo "value: " , implode(' ',$value) , PHP_EOL , PHP_EOL;
}
key: one@gmail.com
value: 70,80 90,100
key: two@gmail.com
value: 10
|
echo or print_r array into placeholder of div
By : sousou
Date : March 29 2020, 07:55 AM
around this issue It is very basic question. echo gives you array because variable that you want to echo is array. If you want to print array then you can do several things. Use loop like for, foreach etc. Use implode() function to join array keys with some "glue" echo implode(",", $fullAddress) Use array access for example echo $fullAddress['city'];
|