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
Tag: shorthand
PHP if shorthand and echo in one line – possible?
What’s the best, preferred way of writing if shorthand one-liner such as: Plot twist: I need to echo $foo or echo $bar. Any crazy tricks? 🙂 Answer edit: here’s a good read for you on the topic edit: more to read
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