php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #13533 new function
Submitted: 2001-10-03 17:20 UTC Modified: 2010-12-14 12:33 UTC
From: e at arix dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: e at arix dot com
New email:
PHP Version: OS:

 

 [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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-28 21:12 UTC] yohgaki@php.net
Could you explain more clearly with examples?
 [2002-01-28 21:29 UTC] e at arix dot com
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.
 [2010-12-14 12:33 UTC] jani@php.net
-Status: Open +Status: Bogus -Package: Feature/Change Request +Package: *General Issues
 [2010-12-14 12:33 UTC] jani@php.net
preg_match() and PREG_OFFSET_CAPTURE helps. No need for yet another very seldomly needed string function here.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC