the Blog

How to Embed Iframes to HTML

Posted on October 1, 2019 by Michael Rosario  |  Comments

<?php
$url 
"https://www.URL.com";
$data "";
if(
preg_match'/^(http|https):\\/\\/[a-z0-9_]+([\\-\\.]{1}[a-z_0-9]+)*\\.[_a-z]{2,5}'.'((:[0-9]{1,5})?\\/.*)?$/i' ,$url)){
    $curl 
curl_init();
    
curl_setopt($curlCURLOPT_URL$url);
    
curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
    
curl_setopt($curlCURLOPT_HEADERfalse);
    
curl_setopt($curlCURLOPT_FOLLOWLOCATIONtrue);
    
$data curl_exec($curl);
    
curl_close($curl);                   

echo "<div>".$data."</div>";
?> 
comments powered by Disqus

Other Recent Blog

What do I need to be a Web Developer?
Posted on November 8, 2017  |  Comments I was asked recently asked by a college student what he needs to be a "Web Developer." If I were to sum it into one blog entry, it would be a mix of the tools I use, best-practices and the coding languages that I know. It's never to late to learn how to code and learn new tools. Once you have an idea on the basics - it's never too far to learn another. Every single thing online has documentation, youtube videos, and wikis readily available. There are a lot of tools out there and a lot of developers willing to share their two cents on forums and social media.