Date and String formatting

<?php echo $new_date = date('d-M-Y', strtotime($a->date)); ?>

This will display the date in the provided format.



<?php echo $string = substr($a->question,0,50).'...'; ?>

This will truncate the string after 50 characters and will show '...' after that.






Comments