bit confused about function returns.
if i have a function with no real return needed, do i have to return 0 or return false to have a better code?
function example($time)
{
echo $time
//do i need to return 0 here?
};
$foodstore = array('bread','milk','meat','fruits','veges');
$buyer_list = array('bread', 'milk', 'chocolate');
function example($buyer_list , $foodstore)
{
foeach($buyer_list as $item)
{
if(in_array($item, $foodstore)
{
return $item
}
}
//if i have to return only a specific $item, do i need to return 0 if no $item is specified.
}
function example($filename)
{
$file = file_get_contents($filename);
...
file_put_contents($filename, $file);
//do i need to return 0 here?
}