Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4342466
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:37:19+00:00 2026-05-21T11:37:19+00:00

On my new project, members are able to use my YouTube API and it

  • 0

On my new project, members are able to use my YouTube API and it will generate a tag like below for them to use it in whatever textarea they want:

<ymedia>http://www.youtube-nocookie.com/v/qQG0XfU-bFs</ymedia>

I want my PHP profile page to take the string between <ymedia></ymedia> and generate a similar code below using $ymstring for the string collected from the ymedia tag:

<?php
$u_agent = $_SERVER[''HTTP_USER_AGENT''];
if(preg_match(''/Opera/i'',$u_agent)){
<object width="320" height="240" data="".$ymstring."?fs=1&amp;hl=en_US&amp;rel=0"><param name="movie" value="".$ymstring."?fs=1&amp;hl=en_US&amp;rel=0" /><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent" /><param name="bgColor" value="#ffffff" /><param name="flashvars" value="vu=".$ymstring."?fs=1&amp;hl=en_US&amp;rel=0" /></object>
} else {
<object width="320" height="240"><param name="movie" value="".$ymstring."?fs=1&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="".$ymstring."?fs=1&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="240"></embed></object>
}
?>

Basically, I’m trying to find all the ymedia tags in a $string and replace them with my youtube coding above aimed at either Opera or the rest of other browsers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:37:20+00:00Added an answer on May 21, 2026 at 11:37 am

    This should work:

        preg_match("/<ymedia>(.*?)<\/ymedia>/", $Input, $Matches);

    Then, your result would be in $Matches[1] which you could pass as $ymstring.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will start new project which is based on ASP.NET MVC 3 using C#
After initiating a new project, I would like to know when Petrel has completed
we are starting a new project and I would like to know if V5
I'm trying to use SubSonic for a new project with an existing database but
I would like to create a rails 3 project which will serve as a
It's a brand new project. Here's the exact commands I've run: rails new MyProject
In a new project of mine I cannot see the Deployment Assembly link in
Im unable to start new project in a virtualenv. This is what i did
I created a new project, Windows Phone 7.0 Since i wanted the DockPanel, i
I came to a new project which have been developed for a quite long

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.