Feb
4
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

Mail will not be published.

© 2012 · Karl Sheen Blog · Sitemap · Proudly powered by Wordpress and Twitter Bootstrap · Icons by Glyphicons