+ 4
Explain please. Why output is 1111
10 Antworten
+ 7
PHP print statement returns a value of integer type which is always 1, regardless of what argument you give the statement. That’s the source of the extra 1. Read more about echo and print here: https://www.jquery-az.com/php-echo-and-print-statement-with-6-examples/
+ 6
Airree maybe
+ 3
It's from PHP challenge
+ 3
It's a function. The dots are not a part of it, it's just to concatinate it with the 2 1's. It just outputs something on a screen, and returns it
+ 3
Airree Why print(1) or echo print(1) does not work?
+ 3
Airree Why echo 1 .print(2). 1 is 2111?
+ 3
1. It does work.
2. It doesn't return the number I guess, but 1. So, it will be 2111
+ 3
".” the point is a concatenation operation on strings. php considers the “1” as chars and put them together as 111.
+ 2
The print function prints its argument then returns it. So if you think about it, first, you print 1, then you echo 1.1.1, which is 111
+ 2
What is .print(1). ?