/    Sign up×
Community /Pin to ProfileBookmark

Is:

<?php
$txt1=”Hello World!”;
$txt2=”What a nice day!”;
echo $txt1 . ” ” . $txt2;
?>

The same as:

<?php
$txt1=”Hello World!”;
$txt2=”What a nice day!”;
echo $txt1 . ” ” $txt2 .;
?>

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMar 05.2012 — Well, the 2nd one won't parse/compile. ?

I suspect a sort of answer to your question is that these will all output the same thing:
[code=php]
$txt1 = "Hello World!";
$txt2 = "What a nice day!";

echo "$txt1 $txt2<br />n";
echo "{$txt1} {$txt2}<br />n";
echo $txt1 . " " . $txt2 . "<br />n";
printf("&#37;s %s<br />n", $txt1, $txt2);
[/code]
Copy linkTweet thisAlerts:
@asaauthorMar 05.2012 — I´m just a beginner! What´s exactly the difference between ´echo´ and ´print´?
Copy linkTweet thisAlerts:
@NogDogMar 05.2012 — echo and print are generally synonymous. (There are some small differences that you can ignore 99.99&#37; of the time.) print[b]f[/b](), on the other hand, is significantly different, in that it allows you to use the first argument as a sort of template, and the successive arguments to replace the place-holders in that template (the "%s" string place-holders in my prior example).
Copy linkTweet thisAlerts:
@asaauthorMar 05.2012 — echo and print are generally synonymous. (There are some small differences that you can ignore 99.99% of the time.) print[b]f[/b](), on the other hand, is significantly different, in that it allows you to use the first argument as a sort of template, and the successive arguments to replace the place-holders in that template (the "%s" string place-holders in my prior example).[/QUOTE]



Ok, thanks!
×

Success!

Help @asa spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...