Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $array = array(
- '1' => array(
- 'name' => 'André',
- 'id' => '1'
- ),
- '2' => array(
- 'name' => 'John',
- 'id' => '2'
- ),
- '3' => array(
- 'name' => 'João',
- 'id' => '3'
- )
- );
- $Nome = 'John';
- echo '<hr/><pre><code>';
- print_r($array);
- echo '</code></pre><hr/>';
- var_dump(in_array($Nome, $array, true));
- echo '<hr/>';
- var_dump(array_search($Nome, $array));
- echo "<hr/>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement