samedi 21 février 2015

PHP function if function == true

Hello i have problem with the odd or even, i want to do function on that i have this and im getting error: Parse error: syntax error, unexpected 'spocti' (T_STRING), expecting '(' in C:\xampp\htdocs\functions.php on line 34 i have this code



<form method= "post" action= "">
<input type= "text" name= "cislo" />
<input type= "submit" name= "submit" />
</form>

<?php
if (isset($_POST['cislo'])){

$cislo = $_POST['cislo'];

function spocti(){
if ($cislo % 2 == 0)
return true;
}
}
if (function spocti == true){
echo "Its even";
}
?>

Aucun commentaire:

Enregistrer un commentaire