Login
Remember
Register
PHPOnlineSupport
Questions
Unanswered
Tags
Categories
Ask a Question
Ask a Question
Strange “1” displayed at the end of a php print_r ?
0
votes
2.3k
views
asked
Nov 19, 2018
in
General
by
Rustam
Can someone explain me what and why this "1" is displayed at the end of print_r function?
echo '<pre>'
echo print_r($validation->getErrorFields());
echo '</pre>'
print_r
Your comment on this question:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
1
Answer
0
votes
answered
Nov 19, 2018
by
Sahan
Remove the echo before print_r
the print_r is supposed to return true/false which is displayed as 1 with the echo.
So you only need the following.
echo '<pre>'
print_r($validation->getErrorFields());
echo '</pre>'
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Related questions
0
votes
1
answer
710
views
Check where the current time is between a given time limit or not - PHP
asked
May 19, 2016
in
General
by
Mike
php
date
0
votes
2
answers
10.1k
views
In PHP using Ternary Operator without the Else statement
asked
Jul 31, 2017
in
General
by
Fahad
php
ternary
if
else
+2
votes
1
answer
1.2k
views
Fix the magic quotes deprecated in php 7
asked
Feb 14, 2017
in
General
by
Dip
fix
magic-quotes
deprecated
php7
0
votes
1
answer
172
views
Read the PDF with PHP
asked
Aug 19, 2016
in
General
by
Azi Graeber
php
python
pdf
read
0
votes
1
answer
673
views
Install version of PHP Buildpack extension, Phalcon?
asked
Jul 29, 2016
in
Phalcon
by
Sumeeth
buildpack
phalcon
php
0
votes
1
answer
1.2k
views
Run a Magento Code out of installation folder
asked
Jun 22, 2016
in
Magento
by
Annabelle
magento
All categories
General
(38)
CMS
(21)
Frameworks
(20)
eCommerce
(58)
IOT - Internet Of Things
(4)
Javascript
(6)
Databases
(1)
Categories
All categories
General
(38)
CMS
(21)
Frameworks
(20)
eCommerce
(58)
IOT - Internet Of Things
(4)
Javascript
(6)
Databases
(1)
Most popular tags
magento
wordpress
php
wp
category
module
product
laravel
kohana
admin
url
cache
jquery
database
configurable
serial1
serial
encrypt
phalcon
truncate
fishpig
js
include
javascript
cms
backend
email
plugin
post
arduino
seo
security
migrate
editor
decrypt
python
iot
map
json
shipping
password
core
log
mage
pear
string
replace
extension
import
php7
error
function
form
order
google
image
youtube
customer
site-links
adblocker
qr-code
barcode
samsung
mac
popup
newsletter
feed
auto-numbering-column
datatable
admin-bar
adminbar
toolbar
mongodb
address16
address64
xbee
301
302
parents
execution-time
calculate
case-sensitive
contains
interface-class
abstract-class
ternary
ajax
cancel
oracle12c
xampp
isset
submit
extract
matrix
uno
mega
coupon
print_r
programatically
member
...