W
W
wixtransfer2018-06-01 00:45:53
YouTube
wixtransfer, 2018-06-01 00:45:53

How to remake a link using PHP?

Guys, do not tell me how to get from this link:
https://www.youtube.com/watch?v=jlr3w0MS0k8
Like this:
https://www.youtube.com/v/jlr3w0MS0k8
That is, you need to remove watch?v= and replace it with v/
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
ymer, 2018-06-01
@wixtransfer

$string = 'https://www.youtube.com/watch?v=jlr3w0MS0k8';
echo str_replace('watch?v=', 'v/', $string);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question