Skip to content
Advertisement

Tag: shorthand

php shorthand return statement

So i was just recently looking for some examples of validating a unix timestamp. One code chunk that kept reappearing was this: Now I have looked for shorthand return if statements which I think this might be but I am not having any luck. can anyone explain to me how this function is deciding what to return and how. Thanks

php isset shorthand else return array not working

I have this php code line Is something wrong with the isset shorthand because when I print_r($data[‘viewData’][‘filter’] with else being active, returns nothing/null/empty. What could be wrong? Edit, to add more info: Code inside the controller: Code inside view: And I get nothing when the else enters Codeigniter is used as framework *prePrint is just a custom function that contains

Advertisement