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
3.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
8.8k
views
json_encode Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data
asked
Feb 3, 2022
in
Javascript
by
Jaison
json
syntaxerror
0
votes
1
answer
1.1k
views
What are the different types of PHP variables?
asked
Oct 29, 2021
in
General
by
anonymous
php
0
votes
1
answer
1.2k
views
What is the meaning of ‘escaping to PHP’
asked
Oct 29, 2021
in
General
by
Tester Testee
(
220
points)
0
votes
1
answer
1.8k
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
0
answers
681
views
How notice error displayed on php program?
asked
Oct 4, 2021
in
General
by
anonymous
php
0
votes
0
answers
4.1k
views
PHP: Can PHP cURL retrieve response headers AND body in a single request?
asked
Oct 29, 2021
in
General
by
mithun
(
1.3k
points)
All categories
General
(56)
CMS
(21)
Frameworks
(21)
eCommerce
(58)
IOT - Internet Of Things
(10)
Javascript
(10)
Databases
(5)
Categories
All categories
General
(56)
CMS
(21)
Frameworks
(21)
eCommerce
(58)
IOT - Internet Of Things
(10)
Javascript
(10)
Databases
(5)
Most popular tags
magento
php
wordpress
wp
laravel
category
database
module
product
arduino
kohana
js
jquery
admin
date
url
sing
birds
json
javascript
cms
cache
error
configurable
love
mac
xbee
serial1
serial
seo
encrypt
recaptha
phalcon
truncate
fishpig
include
backend
function
email
plugin
post
arduinojson
popup
mongodb
security
migrate
editor
decrypt
python
iot
map
shipping
password
core
log
mage
pear
string
replace
extension
import
php7
form
order
day
google
image
youtube
https
http
customer
syntaxerror
datatables
nested
x-ctu
xctu
pan-id
mesh
coordinator
esp
baud
esp8266
esp32
path-issue
site-links
adblocker
qr-code
barcode
samsung
newsletter
feed
auto-numbering-column
datatable
admin-bar
adminbar
toolbar
address16
address64
301
302
...