As a newbie, I tried to create a function.
The function should read a content of an already used variable (e.g. $t=’’😉 and if it has nothing inside it should assign 0 instead.
I wrote it like this but it does not work, why?
<?php
$t='';
function aszero($var)
{
trim($var);
if ($var=='')
{
$var=0;
}
}
aszero($t);
echo($t);
?>