Created
March 29, 2018 03:33
-
-
Save lastday154/09b51ec113c071fd7e3b8448ab06f004 to your computer and use it in GitHub Desktop.
isset vs in_array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $fields = ['id', 'availability', 'condition', 'description', 'image_link', 'link', 'title', 'price', 'currency']; | |
| var_dump(isset($fields['id'])); | |
| var_dump(isset($fields[0])); | |
| var_dump(in_array('id', $fields)); | |
| bool(false) | |
| bool(true) | |
| bool(true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment