apache-redirect-http-to-https-using-htaccess-rewrite-rules

How to redirect non-www to www using htaccess (Vice versa)

For a website or web application user to access the website with or without “www” (e.g. techdasher.com or www.techdasher.com) for same page. It will be consider as “duplicate content”. Due to this website rank to be drop. The advantage of redirecting a website -> An unique website url avoid to split the page rank. -> Website url is […]



PHP shuffle an array with all values are in different position

PHP shuffle an array with all values are in different position

Hi all! PHP shuffle an array using shuffle(). But some times the values are in same position. The simple PHP script for shuffling an array with all values are in different position. function arrayshuffle($array_input) { $array_shuffle=$array_input; while(count(array_intersect_assoc($array_input, $array_shuffle))) {shuffle($array_shuffle); } return $array_shuffle; } The sample Input and output as follow $array_input=array(1,2,3,4,5); print_r($array_input); print_r(arrayshuffle($array_input));   Input […]

Tags:



Tech Dasher

PHP Send Email with HTML and Multiple Attachments

In this post I’ve to share sending email along with html and multiple attachment using php. The sample PHP script. <?PHP $from=’from@xxx.com’; $to=’to@yyy.com’; $subject=’Email Subject’; $emailmessage=’Email Message’; $attachment_1=’testfile1.pdf’; $attachment_2=’testfile2.pdf’; $mimeboundary = md5(time()); $eol = PHP_EOL; // header $headers  = “From: “.$from.$eol; $headers .= “MIME-Version: 1.0”.$eol; $headers .= “Content-Type: multipart/mixed; boundary=””.$mimeboundary.”””; // body $message = “–“.$mimeboundary.$eol; […]

Tags: