Variable Functions

February 4th, 2010 | Php

Using a variable to store the returned data of a function. Instead of typing multiple literal function names, just call the variable.

function what_is_my_country( $var ) {
	echo "My country is $var.";
}

$country = 'what_is_my_country';
$country('United States');

Leave a Reply

  • Name (required)
  • Mail (will not be published) (required)
  • Website
  • Message