Answers for "connect an if statement to an input php"

PHP
0

connect an if statement to an input php

re: #80305

Again useful for newbies:

if you need to compare a variable with a value, instead of doing

<?php
if ($foo == 3) bar();
?>

do

<?php
if (3 == $foo) bar();
?>

this way, if you forget a =, it will become

<?php
if (3 = $foo) bar();
?>

and PHP will report an error.
Posted by: Guest on February-17-2020
-1

connect an if statement to an input php

<input type="hidden" name="q" value="<?php echo isset($_GET["q"]) ? $_GET["q"]: '' ;?>"/>
Posted by: Guest on January-14-2021

Code answers related to "connect an if statement to an input php"

Browse Popular Code Answers by Language