Why PhP logic is very hard. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 15

Why PhP logic is very hard.

php team make the php is easy like concate string and case insensitive and also js is have small hard like if("1e3" == "1000") it's true 😢 😢

25th Jul 2018, 7:36 AM
Yousef Eabitan
Yousef Eabitan - avatar
23 Answers
+ 17
Yousef10 This all the concept == Equal $x == $y Returns true if $x is equal to $y === Identical $x === $y Returns true if $x is equal to $y, and they are of the same type != Not equal $x != $y Returns true if $x is not equal to $y <> Not equal $x <> $y Returns true if $x is not equal to $y !== Not identical $x !== $y Returns true if $x is not equal to $y, or they are not of the same type > Greater than $x > $y Returns true if $x is greater than $y < Less than $x < $y Returns true if $x is less than $y >= Greater than or equal to $x >= $y Returns true if $x is greater than or equal to $y <= Less than or equal to $x <= $y Returns true if $x is less than or equal to $y
25th Jul 2018, 7:42 AM
Sadaam Linux
Sadaam Linux - avatar
+ 6
And 1e3 is a “scientific notation”of numbers (5e3 is 5000, 1.2e5 is 120000, 0.7e2 is 70, can you see a logic how are those numbers notated?)
25th Jul 2018, 10:44 AM
Andrew Harchenko (Tomsk)
Andrew Harchenko (Tomsk) - avatar
+ 4
if("05" =="5") ? :000
25th Jul 2018, 7:38 AM
Yousef Eabitan
Yousef Eabitan - avatar
+ 4
i like your comment <3 it's very useful thank you 💔💔💔
25th Jul 2018, 11:35 AM
Yousef Eabitan
Yousef Eabitan - avatar
+ 3
thanx thanx , thank you , i have some questions. always if(0) is true why ?
25th Jul 2018, 7:43 AM
Yousef Eabitan
Yousef Eabitan - avatar
+ 3
mmm i can't upload img here , wait one second , and thank you ^_6
25th Jul 2018, 7:51 AM
Yousef Eabitan
Yousef Eabitan - avatar
+ 3
this make me confused : "i upload img in website" ibb.co/e0o5B8
25th Jul 2018, 7:58 AM
Yousef Eabitan
Yousef Eabitan - avatar
+ 3
please , can you give me more examples.
25th Jul 2018, 10:49 AM
Yousef Eabitan
Yousef Eabitan - avatar
+ 3
Andrew Harchenko (Tomsk) And Sadaam Linux thanks very much <3
25th Jul 2018, 11:11 AM
Yousef Eabitan
Yousef Eabitan - avatar
+ 3
thanks very much <3
25th Jul 2018, 11:29 AM
Yousef Eabitan
Yousef Eabitan - avatar
+ 3
Yousef10 you're scaring me away from learning PHP,why?
12th Aug 2018, 10:20 AM
Celestino🇰🇪🇫🇷
Celestino🇰🇪🇫🇷 - avatar
+ 2
if (0) isn’t “true”. Perhaps You have seen a question where second option (else) is “echo 01;” but when PHP outputs numbers it drops first (leading) zeroes... (So it looks like first option “echo 1;” is fired ;-))
25th Jul 2018, 10:41 AM
Andrew Harchenko (Tomsk)
Andrew Harchenko (Tomsk) - avatar
+ 2
You see, the numbers after “e” means how many position in decimal numbers decimal point (that “dot”in number) is moved... ...e3 means that you are multiplying the part before “e” and 1000 (three zeroes ~ three position in decimal number...)
25th Jul 2018, 11:09 AM
Andrew Harchenko (Tomsk)
Andrew Harchenko (Tomsk) - avatar
+ 2
:-D “helfull” ;-) 😂
25th Jul 2018, 11:10 AM
Andrew Harchenko (Tomsk)
Andrew Harchenko (Tomsk) - avatar
+ 2
(yep difference between programmind languages is a kind of hell. While I try to study a bunch of them simultaneously [yes, I know that it’s a big mistake...] it makes my brain exploding sometimes 😊)
25th Jul 2018, 11:12 AM
Andrew Harchenko (Tomsk)
Andrew Harchenko (Tomsk) - avatar
+ 2
Andrew Harchenko (Tomsk) Can You Answer For The Comment [7] please ?
25th Jul 2018, 11:13 AM
Yousef Eabitan
Yousef Eabitan - avatar
+ 2
Sadaam Linux You Are Never Lost In Challenge :D ! Nice :) Continue ^_^
25th Jul 2018, 11:18 AM
Yousef Eabitan
Yousef Eabitan - avatar
+ 2
In that given screenshot you are (ok, PHP is) replacing variables $a, $b and $c in a string in _double quotes_ with their values which are 1, 1 and 1 (types don't matter here when we are just outputting 'em) and that's all. (No one is going to make PHP evaluate any arithmetical expressiin in strings, only substitutions of variables are done [or we won't be able to output a string "1+1" ☺])
25th Jul 2018, 11:22 AM
Andrew Harchenko (Tomsk)
Andrew Harchenko (Tomsk) - avatar
+ 2
no don't lost in challenge plz :)
25th Jul 2018, 11:39 AM
Yousef Eabitan
Yousef Eabitan - avatar
+ 2
do you have Facebook account
11th Aug 2018, 8:29 AM
Alineowaz
Alineowaz - avatar