473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

php printing problem

I am having the problem with php printing

print true; // prints 1
print false // dosent print anything

Thanks!!!
Aug 13 '08 #1
7 1309
*** raashid bhatt escribió/wrote (Wed, 13 Aug 2008 10:06:34 -0700 (PDT)):
I am having the problem with php printing

print true; // prints 1
print false // dosent print anything
print needs strings so this is a conversion from boolean into string. These
are the rules:

http://es2.php.net/manual/en/languag...string.casting

"A boolean TRUE value is converted to the string "1". Boolean FALSE is
converted to "" (the empty string). This allows conversion back and forth
between boolean and string values."

You may find var_dump() useful.

--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor en cubitos: http://www.demogracia.com
--
Aug 13 '08 #2
print's overrated, good ol echo, tried and true and also fast than
print (if ever speed did count)
Aug 13 '08 #3
..oO(The Hajj)
>print's overrated, good ol echo, tried and true and also fast than
print (if ever speed did count)
The only little difference is in semantics, not in speed. In practice it
won't matter anyway.

Micha
Aug 13 '08 #4
..oO(raashid bhatt)
>I am having the problem with php printing

print true; // prints 1
print false // dosent print anything
If casted to a string, a FALSE will become the empty string, which makes
perfect sense and is described in the manual.

Micha
Aug 13 '08 #5
On Aug 13, 3:10 pm, Michael Fesser <neti...@gmx.dewrote:
.oO(The Hajj)
print's overrated, good ol echo, tried and true and also fast than
print (if ever speed did count)

The only little difference is in semantics, not in speed. In practice it
won't matter anyway.

Micha
I'm going off language construct versus function but yeah, I've never
ran into where I've noticed a difference.
Aug 13 '08 #6
..oO(The Hajj)
>On Aug 13, 3:10 pm, Michael Fesser <neti...@gmx.dewrote:
>.oO(The Hajj)
>print's overrated, good ol echo, tried and true and also fast than
print (if ever speed did count)

The only little difference is in semantics, not in speed. In practice it
won't matter anyway.

Micha

I'm going off language construct versus function but yeah, I've never
ran into where I've noticed a difference.
JFTR: Both are language constructs. Indeed 'print' behaves more like a
function, though (it sets a return value), but still doesn't require
parentheses.

Micha
Aug 13 '08 #7
On Aug 13, 3:19 pm, Michael Fesser <neti...@gmx.dewrote:
.oO(The Hajj)
On Aug 13, 3:10 pm, Michael Fesser <neti...@gmx.dewrote:
.oO(The Hajj)
print's overrated, good ol echo, tried and true and also fast than
print (if ever speed did count)
The only little difference is in semantics, not in speed. In practice it
won't matter anyway.
Micha
I'm going off language construct versus function but yeah, I've never
ran into where I've noticed a difference.

JFTR: Both are language constructs. Indeed 'print' behaves more like a
function, though (it sets a return value), but still doesn't require
parentheses.

Micha
hmm, I'll have to go inform someone of this, was told print = function
Aug 13 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
1
by: DCraig | last post by:
I'm having problems printing to a line printer from both Crystal Reports and SQL Server reporting services using dotnet. When I try and print a report from an application with Crystal I get the...
5
by: Stefania Scott | last post by:
I am trying to print a word document from Access. The code I've written works well in my computer but does not in the one were it is needed. Here the piece of code: 'doc path strObjectPath =...
5
by: C-Services Holland b.v. | last post by:
Hi all, I've run into a problem trying to print from vb.net (2002) in Windows 98. To test it I've setup a single form with a button and the following code: 'the form has a button called...
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
2
by: Teemu | last post by:
I have an application created with VB6 and now I'm converting it to VB 2005. Conversion is not so simple because printing is so much different. In my app I have Timer-component, which is creates...
2
by: Sukh | last post by:
Hi I am stuck with a problem Can anyone help me out from this... I am printing a report on pre-printed continue paper using dot-matrix printer using vb.net. Data is printing on all the...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.