Hi everyone! I'm the author of code.mu :)
I'd love to chat with my non-Russian audience. I'm looking for your feedback on the site and the translation quality. Let's chat:)
83 of 110 menu

PHP Array Element Existence Check

The in_array function checks for the existence of a given element in an array.

Let an array be given. Let's check for the presence of an element with the value 'b' in it:

<?php $arr = ['a', 'b', 'c']; $elem = in_array('b', $arr) var_dump($elem); ?>

Code execution result:

true
English
БеларускаяEspañolРусский
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline