Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/300627-stripos-not-recognizing-forward-slashes/
Share on other sites

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

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);
?>
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.