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 907 times
Edit
3
Community EvaluationsNo one has reviewed this question yet, be the first!