Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

needle is not a string or an integer

Description

The second argument may be a string, or an integer, which will be used as a string. Any other type is forbidden, in particular array. Other types may yield other error messages, such as a type error.

Example

<?php

print strpos('abc99', []);

?>

Alternatives

  • Use a foreach on an array of strings, and use these values instead.
  • Pick up a value in the array.