Created
March 23, 2013 02:08
-
-
Save oojacoboo/5226090 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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