How to Get Thumbnail From Youtube Video Using PHP

Sometime it’s necessary to display the Thumbnail Image of a youtube video from URL. So in this tutorial am going to example you how to get the thumbnail image of a video from youtube. Here am using PHP to obtain the output. You may also like How to Fullscreen Background Video Using HTML And CSS and Multiple Image Upload in PHP.


        <form method="post" action="">
            <input type="text" name="url" placeholder="Enter URL">
            <input type="submit" name="get_thumbnail" value="GET THUMBNAIL">

PHP Code

    $fetch=explode("v=", $url);
    echo '<img src="'.$videoid.'/0.jpg" width="250"/>';

Leave a Reply

Your email address will not be published. Required fields are marked *