Question from the PHP8 test

Check if a value is in an array in PHP

Medium

What does this code display?

<?php

$array = explode(' ', "Hello world");

$pos = array_search('Hello', $array);

echo in_array($pos, $array) ? 'Yes': 'No';
Author: W3D TeamStatus: PublishedQuestion passed 813 times
Edit
2
Community EvaluationsNo one has reviewed this question yet, be the first!