To unserialize Data

$serialized_data = serialize(array(‘Math’, ‘Language’, ‘Science’)); echo¬† $serialized_data . ‘<br>’; echo ‘<br><br><br>’; $aa = unserialize($serialized_data); print_r($aa);Read more …

To Print Div

<script type=”text/javascript”> function PrintElem(elem) { Popup($(elem).html()); } function Popup(data) { var mywindow = window.open(”, ‘mydiv’, ‘height=400,width=600’); mywindow.document.write(‘<html><head><title>my div</title>’); /*optional stylesheet*/ //mywindow.document.write(‘<link rel=”stylesheet” href=”main.css” type=”text/css” />’); mywindow.document.write(‘</head><body >’); mywindow.document.write(data); mywindow.document.write(‘</body></html>’); mywindow.document.close(); // necessary for IE >= 10 mywindow.focus(); // necessary for IE >= 10 mywindow.print(); mywindow.close(); return true; } </script>Read more …

Date comparison code

echo $date1=strtotime(“31-12-2016”); echo “<br>”; echo $date2=strtotime(“03-01-2017”); echo “<br><br>”; if($date1<$date2) { echo “Second date is bigger”; } else { echo “First date is bigger”; }Read more …