Welcome Guest, Not a member yet? Register   Sign In
Check a function before doing anything?
#3

Do you want to check if a function exists or if the result of your function exists ? I say that because your example looks like checking if $this->auth->is_login() == TRUE.
If you want to check if a method in a class exists, you can use method_exists() or is_callable().
Be careful : method_exists() will return true (or false) for a private/public/protected method whereas is_callable() returns true (or false) for only public method in a class and all method like __call.
Reply


Messages In This Thread
RE: Check a function before doing anything? - by casa - 04-12-2015, 11:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB