PHP Shorthand If / Else Examples
In looking at my Google Analytics statistics, I see a lot of visitors searching for PHP shorthand if/else (ternary) information. I’ve gone through my code library and picked out some examples of ternary operator usage. Basic True / False Declaration $is_admin = ($user[‘permissions’] == ‘admin’) ? true : false; Conditional Welcome Message echo ‘Welcome ‘.($user[‘is_logged_in’] … Continue reading PHP Shorthand If / Else Examples
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed