Twitsnip is a place to post code snippets and share them. Login with your existing Twitter account, if you don't have a Twitter account simply create on at www.twitter.com

Change a variable to

Change a variable to

0

This simple function checks the name of a variable and if it is a certain value changes it, else it will return the original value.

function change_name($orignal, $if_name, $change_to) {
if (strtolower($orignal) == strtolower($if_name)){ return $change_to;} 
	else { return $orignal; }
}

Tags: Php, change name of variable

Comments

No comments yet

Login to Twitter to comment