## GET YOUTUBE VEDIO <?php function getYoutubeEmbedUrl($url) { $shortUrlRegex = ‘/youtu.be\/([a-zA-Z0-9_]+)\??/i’; $longUrlRegex = ‘/youtube.com\/((?:embed)|(?:watch))((?:\?v\=)|(?:\/))(\w+)/i’; if (preg_match($longUrlRegex, $url, $matches)) { $youtube_id = $matches[count($matches) – 1]; } if (preg_match($shortUrlRegex, …
Read MoreAfter post showing page not responding in chrome
## FOR CROME SHOWING This page isn’t working PROBLEM:: This page isn’t working Chrome detected unusual code on this page and blocked it to protect …
Read MoreCrome browser showing page not working after post data in php
## FOR CROME SHOWING This page isn’t working PROBLEM:: This page isn’t working Chrome detected unusual code on this page and blocked it to protect …
Read MoreRead directory in php
## READ DIRECTORY //get all files in directory //$path = directory name; $files1 = scandir($path); print_r($files1);
Read MoreGet all contents and files in Directory in php
## GET CONTENTS IN A DIRECTORY $theme_contents_all = array(); $theme_contents_files = array(); // Open a directory, and read its contents if (is_dir(MINI_USER_THEME_DIR)){ //check if exists, …
Read MoreHow to show YouTube vedio using youtube link in php
## GET YOUTUBE VEDIO <?php function getYoutubeEmbedUrl($url) { $shortUrlRegex = ‘/youtu.be\/([a-zA-Z0-9_]+)\??/i’; $longUrlRegex = ‘/youtube.com\/((?:embed)|(?:watch))((?:\?v\=)|(?:\/))(\w+)/i’; if (preg_match($longUrlRegex, $url, $matches)) { $youtube_id = $matches[count($matches) – 1]; } if (preg_match($shortUrlRegex, …
Read MoreSend email with attachment using PHP Mailer
$email = new PHPMailer(); $email->From = ‘you@example.com’; $email->FromName = ‘Your Name’; $email->Subject = ‘Message Subject’; $email->Body = $bodytext; $email->AddAddress( ‘destinationaddress@example.com’ ); $file_to_attach = ‘PATH_OF_YOUR_FILE_HERE’; $email->AddAttachment( …
Read MoreEmail with attachment
$file = $path.$filename; $content = file_get_contents( $file); $content = chunk_split(base64_encode($content)); $uid = md5(uniqid(time())); $name = basename($file); // header $header = “From: “.$from_name.” <“.$from_mail.”>\r\n”; $header .= …
Read MoreSend Attachment using email
$filename = ‘myfile’; $path = ‘your path goes here’; $file = $path . “/” . $filename; $mailto = ‘mail@mail.com’; $subject = ‘Subject’; $message = ‘My …
Read MoreOn delete Cascade in php
## ON Delete Cascade: Cascade will work when you delete something on table Courses. Any record on table BookCourses that has reference to table Courses …
Read More