Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $default_lat = 23.9;
- $default_lon = 90.8;
- $user_lat = 20.8;
- // output by the ternary operator
- //$lat = isset($user_lat) ? $user_lat : $default_lat;
- // output by null Coalescing operator
- $lat = $user_lat ?? $default_lat;
- echo $lat;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement