--- Pieter <[EMAIL PROTECTED]> wrote:
> I recently started coding online and i have the weirdest response,
> my code is:
>
> if ($id = "add" )
When you convert the string "add" to a boolean, it equates to true.
I'm assuming you want to be using a conditional expression rather than an
assignment
Pieter wrote:
I recently started coding online and i have the weirdest response, my code is:
include 'function.inc';
echo "$id";
print (gettype($id));
if ($id = "add" )
{
echo "is add";
exit;
}
'=' sets value. '==' checks equality.
http://www.php.net/manual/en/language.operators.comp
On Sat, 2003-11-22 at 13:57, Pieter wrote:
> I recently started coding online and i have the weirdest response, my code is:
>
>
> include 'function.inc';
>
> echo "$id";
>
> print (gettype($id));
>
> if ($id = "add" )
>
> {
>
> echo "is add";
>
> exit;
>
> }
>
>
> if ($id = "own" )
>
3 matches
Mail list logo