if( strpos($websiteLink, “http://”) !== false || strpos($websiteLink, “https://”) !== false){ $websiteLink = $val[‘website’]; }else{ $websiteLink = ‘http://’.$val[‘website’]; }
Read MoreCheck whether url contains http:// or https://
Check whether url contains http:// or https:// if your string is a URL you can use parse_url(), which will return the URL components in an …
Read Moremake slug in javascript or jquery
** make slug in javascript or jquery:: <script type=”text/javascript”> //Make Slug:: function slugify(text) { return text.toString().toLowerCase() .replace(/\s+/g, ‘-‘) // Replace spaces …
Read Moreset max height of adsense responsive ad unit
set max height of adsense responsive ad unit:: Ad height is (automatically) determined by adsbygoogle.js (that is smart sizing) and if you want to control …
Read MoreReduce the image file size using PHP
Reduce the image file size using PHP: <?php $name = ”; $type = ”; $size = ”; $error = ”; function compress_image($source_url, $destination_url, $quality) …
Read MoreCheck if image exists in folder or not currupted in php
Check if image exists in folder or not currupted in php:: $full_path = Full Image path; (Like: ../dd/tmp.jpg) if(!file_exists($full_path)){ //Image Not Available or …
Read Morecheck if exists in string in php
check if exists in string in php $a = ‘How are you?’; if (strpos($a, ‘are’) !== false) { echo ‘true’; } OR // returns true …
Read MoreScraping Data in php
Scraping Data in php:: There is PHP Simple HTML DOM Parser. It’s fast, easy and super flexible. There is PHP Simple HTML DOM Parser. It’s …
Read Moreupdate all row in codeigniter
update all row in codeigniter $this->db->update_batch() Generates an update string based on the data you supply, and runs the query. You can either pass …
Read MoreTwo submit buttons in one form
Two submit buttons in one form:: We can use more than one submit button in a single form. We can use more than one submit …
Read More