StoneColdMagic Posted January 23, 2016 Share Posted January 23, 2016 Hey everyone! Any ideas why $idPos below is returning zero/false? I've tried '//v//', '\/v\/' (backslash, forward slash, v, backslash, forward slash) I can't seem to get it to work. $url = 'https://www.youtube.com/v/9hYj_PFZGug'; $idPos = stripos($url, '/v/'); Thanks, Jeff Quote Link to comment https://forums.phpfreaks.com/topic/300627-stripos-not-recognizing-forward-slashes/ Share on other sites More sharing options...
requinix Posted January 23, 2016 Share Posted January 23, 2016 Nope. What's your real code? Quote Link to comment https://forums.phpfreaks.com/topic/300627-stripos-not-recognizing-forward-slashes/#findComment-1530262 Share on other sites More sharing options...
StoneColdMagic Posted January 26, 2016 Author Share Posted January 26, 2016 I'm not sure what you mean. That is the real code. The only thing I didn't put there is this: echo $idPos; It's not finding /v/ in the string and therefore nothing echos out. However, if you search for any other part of that url, it works just fine. It just won't see "/v/" Any help would be appreciated. Thanks, Jeff Quote Link to comment https://forums.phpfreaks.com/topic/300627-stripos-not-recognizing-forward-slashes/#findComment-1530419 Share on other sites More sharing options...
cyberRobot Posted January 26, 2016 Share Posted January 26, 2016 The code works for me also... What version of PHP are you using? Also, is PHP set to show all errors and warnings? Note that you can add the following to the top of your script during the debugging process: <?php error_reporting(E_ALL); ini_set('display_errors', 1); ?> Quote Link to comment https://forums.phpfreaks.com/topic/300627-stripos-not-recognizing-forward-slashes/#findComment-1530422 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.