How would I make that code do tho following: if $data['username'] (doesn't equal) $username{ }.PHP Code:if($data['username'] == $username){
}
I know you have to use an exclamation mark somewhere (!) but I don't know where. +rep
How would I make that code do tho following: if $data['username'] (doesn't equal) $username{ }.PHP Code:if($data['username'] == $username){
}
I know you have to use an exclamation mark somewhere (!) but I don't know where. +rep
visit my internet web site on the internet
http://dong.engineer/
it is just videos by bill wurtz videos you have been warned
thanks.
Just something you might want to take note on, when checking if something is true or false it is in fact quicker to use === compared to == and same applies with !== and !=, and I believe it would be a good practice to do so to micro-optimize in advance. Also some benchmarking I did also found that comparing a variable to a string with ===, compared to == is also faster but in the end it's up to you and the conditions you are faced with.
It's also not the same thing at all, === is a strict match where == is a regular match.Just something you might want to take note on, when checking if something is true or false it is in fact quicker to use === compared to == and same applies with !== and !=, and I believe it would be a good practice to do so to micro-optimize in advance. Also some benchmarking I did also found that comparing a variable to a string with ===, compared to == is also faster but in the end it's up to you and the conditions you are faced with.
$hello = 0;
$hallo = '0';
You should be able to figure it out from that.PHP Code:if( $hallo == $hello )
{
echo 'hello<br />';
}
if( $hallo === $hello )
{
echo 'hallo<br />';
}
visit my internet web site on the internet
http://dong.engineer/
it is just videos by bill wurtz videos you have been warned
I'm aware of this Jewish Bear. I do know what I'm talking about, the === operator matches the type too be it string, int, float, double, etc. Amazing that someone actually know's what they're talking abut before posting aye? In his case if he used === it would be plausible because they'll both be strings if I'm not mistaken.
Example, just because I can. (Not Relevant)
Edit: Just re-read my post (the prior one) no where did I say that they're the same thing. I was saying it was quicker to use the === operator when comparing true or false implying that true and false were not strings and they're both in the same form of true/false e.g. 1 and 0 or true and false. But no where did I say === and == are the same, so I don't know where you got this idea from.PHP Code:<?php
$int = 10;
$float = 10.0;
if ($int === $float)
{
echo "They're the same!";
}
?>
Last edited by Iszak; 17-11-2008 at 06:19 PM. Reason: added example
How many threads have you actually created?
You should just read a few tutorials.
Want to hide these adverts? Register an account for free!