|
Posted by My Pet Programmer on 12/28/07 15:11
jodleren said:
> On Dec 28, 4:43 pm, Iván Sánchez Ortega <ivansanchez-...@rroba-
> escomposlinux.-.punto.-.org> wrote:
>> My Pet Programmer wrote:
>>>>> I was reading php.net for a way to find a number of characters in a
>>>>> strings. Say I want to look for a b and c ind $string.
>>>>> As far as I could see, there is no function for that.
>>>> preg_match("[abc]",$subject);
>>> That will only tell you if any of the characters are in the string. Do
>>> you have one that will say whether all of them are in the haystack?
>> Are you looking forhttp://php.net/count_chars??
>> What are you trying to do, exactly?
>
> To check for invalid characters in a filename
>
> WBR
> Sonnich
preg_match("*[abc]*", $haystack); worked for me.
~A!
--
Anthony Levensalor
anthony@mypetprogrammer.com
Only two things are infinite, the universe and human stupidity,
and I'm not sure about the former. - Albert Einstein
Navigation:
[Reply to this message]
|