## 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 MoreCodeIgniter
Send 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 MoreEmail Validation check in javascript
## Used To Validate Email In Javascript <script > function validateEmail(email) { var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; return emailReg.test( email ); …
Read MoreUpload image in php
#IMAGE UPLOAD if ($_FILES[‘list1’][‘name’] != “”) { $allowed_ext = array(“jpg”, “jpeg”, “png”, “gif”); $extension = explode(‘.’, $_FILES[“list1”][“name”]); $ext = strtolower(end($extension)); if (in_array($ext, $allowed_ext)) { $newname …
Read MoreData table options
# DataTable Link # Data Table Options # Modify Data table data show option # Modify Datatable Page Show Value <script type=”text/javascript” src=”//cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js“></script> <script type=”text/javascript”> …
Read MoreOn select redirect to selected option
## On Select Option Redirect to Another Page $(“#getcity_understate”).on(‘click’, function(){ var s = $(“#under_state_id”).val(); window.location.href = “manage_city_list.php?ustate_id=”+s; });
Read MoreHow to show location in Google maps
$location = “kolkata”; <div style=”width: 100%”> <iframe width=”100%” height=”480″ frameborder=”0″ scrolling=”no” marginheight=”0″ marginwidth=”0″ src=”https://maps.google.it/maps?q=<?php echo $location;?>&output=embed”></iframe> </div>
Read More