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 8029763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:32:05+00:00 2026-06-05T00:32:05+00:00

This the video from witch i want to get the og:title http://www.youtube.com/watch?feature=player_embedded&v=A683kmvRH_8 Php code

  • 0

This the video from witch i want to get the og:title

http://www.youtube.com/watch?feature=player_embedded&v=A683kmvRH_8

Php code

function file_get_contents_curl($url){
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_HEADER, 0);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
            $data = curl_exec($ch);
            curl_close($ch);
            return $data;
        }

        $html = file_get_contents_curl($pageurl);

        $doc = new DOMDocument();
        @$doc->loadHTML($html);
        $nodes = $doc->getElementsByTagName('title');

        $titleBackUp = $nodes->item(0)->nodeValue;

        $metas = $doc->getElementsByTagName('meta');

        for ($i = 0; $i < $metas->length; $i++){
            $meta = $metas->item($i);
            if($meta->getAttribute('name') == 'title')
                $title = $meta->getAttribute('content');
        }

The title is Мастило – В ръцете ти е най-добре [HQ] and i’m getting

ÐаÑÑило – Ð ÑÑÑеÑе Ñи е най-добÑе [HQ]

I try also with

 curl_setopt( $ch, CURLOPT_ENCODING, "UTF-8" );

but it dosent work.

I try with html_entity_decode but is not working

  • 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-06-05T00:32:05+00:00Added an answer on June 5, 2026 at 12:32 am

    This can happen if the document itself doesn’t contain a <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> tag.

    You can try either of the following:

    1. Let DomDocument load the HTML directly from the server (i.e. use ->loadHTMLFile())

    2. Prefix the document with aforementioned meta tag before running it through ->loadHTML().

    For example, you could do this:

    libxml_use_internal_errors(true);
    $doc->loadHTML('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . $html);
    libxml_clear_errors();
    

    It’s a hack to let libxml know it’s supposed to read utf-8 data … it’s not possible to pass that encoding via ->loadHTML().

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

Sidebar

Related Questions

I've watched this video from Google I/O 2009: http://www.youtube.com/watch?v=AgaL6NGpkB8 where Brett shows microblogging example.
Does anybody knows how to get url to video file from this url: http://vk.com/video_ext.php?oid=6492&id=141771975&hash=a984f2edb68fc4f7
I'm trying to play video from youtube using this code but I get this
I'm trying to get the video data from this youtube playlist feed and add
I found this code snippet to retrieve the title from a YouTube video and
so i continue from this question YouTube: get youtube title+ image+description like facebook `
I use until now this code for saving video that i get from UIImagePickerController
Can anybody help me in this? I want to get an screenshot from an
I'm creating a Bookmarklet for YouTube, i want to get the ID from the
In this video, taken from Stanford's CS107 lecture, the professor seems to state that

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.