In this example code, I am running wild card searches in all the functions. Chances are that function alkali() will give a right answer and the other function a wrong answer and vice versa.
How do I suppress the fail part on one function once I get a right / correct answer on another function? I.e, I want to not show "metal is unknown" if I already show "this is an alkali metal".
<?php
class metals
{
function alkali()
{
if (($rowC['description'] == " Alkali Metal")) {
echo '';
} else {
echo 'metal is unknown';
}
}
function alkaline_earth()
{
if (($rowC['description'] == " Alkali earth Metal")) {
echo ' this is an alkali earth metal';
} else {
echo 'metal is unknown';
}
}
//end of class
}
// create an object for class name
$abc = new metals();
$abcd = new metals();
// call the functions in the class
$abc->alkali();
$abcd->alkaline_earth();
?>