|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2001-10-03 17:20 UTC] e at arix dot com
 would just like to suggest creating a new function (perhaps called strset) that takes a haystack as its first parameter and a string of needles i.e. a string each of whose characters will be looked for in the haystack. finding ANY of those characters the function should return the index. would be very useful to have this. - erick PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 14:00:01 2025 UTC | 
strset("This is a sample haystack", "ixbt") returns 3 because "i" was found in the haystack. strset("This is a sample haystack", "xbt") returns 0 because none of the characters in "xbt" are found in the haystack strset("This is a sample haystack", "xbts") returns 4 because it finds it at the end of "this" syntax: strset(haystack, needles) essentially strset is a function that iterates through the needles testing for the presence of each in the haystack.