xxxxxxxxxx
<?php if(isset($_GET['name'])): ?>
Your name is <?php echo $_GET["name"]; ?>
<?php endif; ?>
xxxxxxxxxx
<?php if(isset($_GET['name'])): ?>
Your name is <?php echo $_GET["name"]; ?>
<?php endif; ?>
xxxxxxxxxx
<?php if(isset($_GET['fname']) && isset($_GET['age'])): ?> //isset is important
<br/>
Your name is <?php echo $_GET["fname"]; ?>
<br/>
Your age is <?php echo $_GET["age"]; ?>
<?php endif; ?>
xxxxxxxxxx
set_error_handler(function($errno, $error){
if (!str_starts_with($error, 'Undefined array key')){
return false; //default error handler.
}else{
trigger_error($error, E_USER_NOTICE);
return true;
}
}, E_WARNING);
then
ini_set ("error_reporting", E_ALL & ~E_NOTICE & ~E_USER_NOTICE)
xxxxxxxxxx
<?php if(isset($_GET['name'])): ?>
Your name is <?php echo $_GET["name"]; ?>
<?php endif; ?>
xxxxxxxxxx
<?php if(isset($_GET['name'])): ?>
Your name is <?php echo $_GET["name"]; ?>
<?php endif; ?>
xxxxxxxxxx
<?php if(isset($_GET['name'])): ?>
Your name is <?php echo $_GET["name"]; ?>
<?php endif; ?>
xxxxxxxxxx
<?php if(isset($_GET['name'])): ?>
Your name is <?php echo $_GET["name"]; ?>
<?php endif; ?>
xxxxxxxxxx
<?php
$array = array(
'fruit1' => 'apple',
'fruit2' => 'orange',
'fruit3' => 'grape',
'fruit4' => 'apple',
'fruit5' => 'apple');
// this cycle echoes all associative array
// key where value equals "apple"
while ($fruit_name = current($array)) {
if ($fruit_name == 'apple') {
echo key($array).'<br />';
}
next($array);
}
?>