Skip to content

Instantly share code, notes, and snippets.

@oojacoboo
Created March 23, 2013 02:08
Show Gist options
  • Select an option

  • Save oojacoboo/5226090 to your computer and use it in GitHub Desktop.

Select an option

Save oojacoboo/5226090 to your computer and use it in GitHub Desktop.
/**
* Global function for returning back an array from a function with possible error string
* @param string $error
* @return array
*/
function returnError($error = "Error performing this operation") {
return array("success" => false, "error" => $error);
}
/**
* Global function to return back a success status and any other possible properties
* @param array $successArray
* @return array
*/
function returnSuccess($successArray = array()) {
$successArray["success"] = true;
return $successArray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment