473,402 Members | 2,053 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,402 software developers and data experts.

using PRINT command and "+" to concatenate strings

New learner.

For the print command and concatenation, the period is difficult for
my afflicted eyes to see, but the "+" seems to work. Is this an
accepted PHP convention?

Thank you,
David
Mar 3 '08 #1
9 1738
Dave-o wrote:
New learner.

For the print command and concatenation, the period is difficult for
my afflicted eyes to see, but the "+" seems to work. Is this an
accepted PHP convention?

Thank you,
David
Nope. + is addition, not concatenation.

<?php
print("abc" + "def"):
?>

Result:

0

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Mar 3 '08 #2
On Mar 3, 7:12 am, Dave-o <dave.a...@gmail.comwrote:
New learner.

For the print command and concatenation, the period is difficult for
my afflicted eyes to see, but the "+" seems to work. Is this an
accepted PHP convention?

Thank you,
David
======================

Follow-up...Note to self: No, it doesn't work!

Hmmm....Is there anything other than a period that can be used for
concatenation of strings when using the print command?

Thanks,
David
Mar 3 '08 #3
Dave-o wrote:
On Mar 3, 7:12 am, Dave-o <dave.a...@gmail.comwrote:
>New learner.

For the print command and concatenation, the period is difficult for
my afflicted eyes to see, but the "+" seems to work. Is this an
accepted PHP convention?

Thank you,
David

======================

Follow-up...Note to self: No, it doesn't work!

Hmmm....Is there anything other than a period that can be used for
concatenation of strings when using the print command?

Thanks,
David
No. Period is the concatenation operator in PHP. And yes, it's hard
for me to see, also. :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Mar 3 '08 #4
On Mar 3, 6:51 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Dave-o wrote:
On Mar 3, 7:12 am, Dave-o <dave.a...@gmail.comwrote:
New learner.
For the print command and concatenation, the period is difficult for
my afflicted eyes to see, but the "+" seems to work. Is this an
accepted PHP convention?
Thank you,
David
======================
Follow-up...Note to self: No, it doesn't work!
Hmmm....Is there anything other than a period that can be used for
concatenation of strings when using the print command?
Thanks,
David

No. Period is the concatenation operator in PHP. And yes, it's hard
for me to see, also. :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Good to know. Thank you for the response. I'll go on squinting.

David
Mar 3 '08 #5
"Dave-o" <da*******@gmail.comwrote in message
news:f1**********************************@f47g2000 hsd.googlegroups.com...
On Mar 3, 6:51 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Dave-o wrote:
On Mar 3, 7:12 am, Dave-o <dave.a...@gmail.comwrote:
New learner.
>For the print command and concatenation, the period is difficult for
my afflicted eyes to see, but the "+" seems to work. Is this an
accepted PHP convention?
>Thank you,
David
======================
Follow-up...Note to self: No, it doesn't work!
Hmmm....Is there anything other than a period that can be used for
concatenation of strings when using the print command?
Thanks,
David

No. Period is the concatenation operator in PHP. And yes, it's hard
for me to see, also. :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Good to know. Thank you for the response. I'll go on squinting.
Or find an editor font that has bigger ones in? I used to have such a thing
but can't remember where I got it from, sorry.

Mar 3 '08 #6
On Mon, 03 Mar 2008 14:32:55 +0100, John Burton <jo*********@jbmail.com>
wrote:
"Dave-o" <da*******@gmail.comwrote in message
news:f1**********************************@f47g2000 hsd.googlegroups.com....
>On Mar 3, 6:51 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>Dave-o wrote:
On Mar 3, 7:12 am, Dave-o <dave.a...@gmail.comwrote:
New learner.

For the print command and concatenation, the period is difficult
for
my afflicted eyes to see, but the "+" seems to work. Is this an
accepted PHP convention?

Thank you,
David

======================

Follow-up...Note to self: No, it doesn't work!

Hmmm....Is there anything other than a period that can be used for
concatenation of strings when using the print command?

Thanks,
David

No. Period is the concatenation operator in PHP. And yes, it's hard
for me to see, also. :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Good to know. Thank you for the response. I'll go on squinting.

Or find an editor font that has bigger ones in? I used to have such a
thing but can't remember where I got it from, sorry.
With a descent adjustable syntax highlighter, you might be able to give it
a particular color of your choice making it more noticable. UltraEdit does
this fine for instance, I'm sure other editors should also be capable of
this.
--
Rik Wasmus
Mar 3 '08 #7
..oO(Dave-o)
>For the print command and concatenation, the period is difficult for
my afflicted eyes to see, but the "+" seems to work. Is this an
accepted PHP convention?
Of course not, because it's a completely different operator.

Micha
Mar 3 '08 #8
Dave-o wrote:
On Mar 3, 6:51 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Dave-o wrote:
>>On Mar 3, 7:12 am, Dave-o <dave.a...@gmail.comwrote:
New learner.
For the print command and concatenation, the period is difficult for
my afflicted eyes to see, but the "+" seems to work. Is this an
accepted PHP convention?
Thank you,
David
======================
Follow-up...Note to self: No, it doesn't work!
Hmmm....Is there anything other than a period that can be used for
concatenation of strings when using the print command?
Thanks,
David
No. Period is the concatenation operator in PHP. And yes, it's hard
for me to see, also. :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Good to know. Thank you for the response. I'll go on squinting.

David

The only other option is to avoid it as much as necessary:

$str1 = 'Hello';
$str2 = 'world!';

echo "$str1 $str2";

or echo "{$str1} {$str2}"; // brackets do not show

or echo "'$str1 $str2'"; // to enclose a string in single quotes...

or $var = "<any of the above methods>";

....take you pick. double quotes allow variables to be expanded, single
quotes do not. ;)

--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
Mar 3 '08 #9
Greetings, Dave-o.
In reply to Your message dated Monday, March 3, 2008, 15:12:20,
For the print command and concatenation, the period is difficult for
my afflicted eyes to see, but the "+" seems to work. Is this an
accepted PHP convention?
Try to play with text colors. I have better results with grey text on black background.
--
Sincerely Yours, AnrDaemon <an*******@freemail.ru>

Mar 5 '08 #10

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

Similar topics

3
by: Gavin Kreuiter | last post by:
I am looking for some advice on how to debug a program when the debugger "print" command actually clears the corruption. This is not the usual non-initialised memory problem, because the program...
7
by: trint | last post by:
My boss wants me to use stored procedures, but I thought somehow that using c# that ADO.Net was better. Any help is appreciated. Thanks, Trint
6
by: ern | last post by:
printf("C:\myfile.txt"); prints as C:myfile.txt How do I specify string literal ?
0
by: Daniel | last post by:
Does system.xml have any way to transofrm data with an xswl style sheet using strings like MSXML2 does? how to convert this to use System.XML so i do not depend on MSXML2 interop? static...
2
by: kbperry | last post by:
Hi all, I am getting an error message when trying to use the P4 print command via the python api for perforce. Anytime that I run p4c.run("print","-q", eachFile), I keep getting an error...
16
by: saurabhnsit2001 | last post by:
The following program doesn't "seem" to print "hello-out". (Try executing it) #include <stdio.h> #include <unistd.h> int main() { while(1) { fprintf(stdout,"hello-out");
21
by: comp.lang.tcl | last post by:
set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts When I try this within TCL I get the following error:
0
NeoPa
by: NeoPa | last post by:
Intention : To prepare a WHERE clause for multiple field selection, but to ignore any fields where the selection criteria are not set. ONLY WORKS WITH TEXT FIELD SELECTIONS. Scenario : You have...
10
by: Prisoner at War | last post by:
Hi, your friendly neighborhood n00b here, just wondering why on earth the Py3K folks want to mess with a simple thing like the "print" "command" (is that what it's called, a command?), turning it...
3
by: Cameron Simpson | last post by:
On 18Aug2008 11:58, Beema Shafreen <beema.shafreen@gmail.comwrote: | In my script i have to print a series of string , so | | print "%s\t%s\t%s\t%s\t%s\t%s\t" %("a","v","t","R","s","f") | | I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.