Use variable defined outside function : Variable Scope « Language Basics « PHP
- PHP
- Language Basics
- Variable Scope
Use variable defined outside function
<?php
$ilike = "Rock";
function music(){
echo "I love listening to $ilike music!", "\n";
}
music();
?>
Related examples in the same category