Questions tagged [stripos]

stripos is the case-insensitive counterpart of strpos, returning the position of a given string within another string.

67 questions
0
votes
1 answer

Search HTML source for string of 'cdn' after CURL request

I want to try an establish if a website is using a CDN. It's a little wooly but I just want to check if the sourcecode contains 'cdn', based on that I can assume the site is using one. - Terrible I know. Unsure of any other menthod. This is what I…
AJFMEDIA
  • 2,093
  • 6
  • 29
  • 52
0
votes
2 answers

IF statement gives wrong outcome when 1 string is being searched multiple times

So i have these two strings: $title = 'Chair Material Suede Black'; $title = 'Chair Material Suede Red'; This is a snippet from my PHP function: elseif (stripos($title, 'Suede') !== false) { if (stripos($title, 'Red') !== false) { …
MantiNL
  • 69
  • 12
0
votes
3 answers

Bad word check in PHP using stripos

I implemented this "bad word" check function in php: # bad word detector function check_badwords($string) { $badwords = array(a number of words some may find inappropriate for SE); foreach($badwords as $item) { if(stripos($string,…
Andres SK
  • 10,779
  • 25
  • 90
  • 152
0
votes
1 answer

strpos() stripos() problems php

I know this is a regular question and I'm not trying to join the group of people who don't know that strpos() returns the position of the string, and if you want to compare wether it is found or not you have to use the === or the ==! comparision. My…
Narc0t1CYM
  • 499
  • 6
  • 25
0
votes
1 answer

stripos(); searching in 2 variables

Here is my function: function search_title_and_vendor{ if (stripos($title, 'Tsugi') !== false) { if (stripos($vendor, 'Puma') !== false) { return 'Puma Tsugi'; } else { return ''; } } …
MantiNL
  • 69
  • 12
0
votes
0 answers

strpos() / stripos() bug or expected behavior?

I'm trying to check if