Thursday, June 27, 2013

PHP date validation

PHP date validation

Date Validation yyyy-mm-dd <?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ $date = '2013-06-27'; function isValidDate($date) { if(preg_match("/^(\d{4})-(\d{2})-(\d{2})$/", $date, $matches)) { if(checkdate($matches[2], $matches[3], $matches[1])) { return true; } } } if(isValidDate($date)){ echo 'valid date'; } else { echo 'invalid date'; } ?> Date Validation dd-mm-yyyy <?php /*...
PHP function to calculate percentage

PHP function to calculate percentage

This post shows you how to calculate a percentage using a division and multiplying its result by 100. This is the simpliest way to calculate a percentage in PHP <?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ function percentage($x, $y, $precision) { // $precision define digit...

Friday, June 21, 2013

Replace characters with icons emoticons php

Replace characters with icons emoticons php

Learn to use PHP to change character sequences into emoticons or icons by using the str_replace function. You will want to alter the string data as it comes out of the MySQL database for display, not when the data is being inserted into the database. # USAGE EXAMPLE  <?php...
Get Favicon From other Website Using PHP

Get Favicon From other Website Using PHP

Learn to get and render favicon.ico files dynamically from other servers in your PHP scripts. You can look for files and also process the DOM structure of external pages on the web. I recommend saving the favicon image file to your server converting it to a JPG or...
Render XML file for Flash Photo Gallery with php

Render XML file for Flash Photo Gallery with php

Learn how to render dynamic XML files for Flash(or any other) Photo Gallery applications using PHP loops to show the most current data at all times. This script would be named something like galleryXML.php This file reads a directory on its own to render the XML file, all you...
Cookies and Session in PHP

Cookies and Session in PHP

Cookies and Session are use in terms of data storage in programming language. But how ? What is the preferable?, When use session?,  When use cookie?,  there are some question which arise in the mind at the time of of store data temp. as well as permanent. There are...

 

© 2014 4everTutorials. All rights resevered.

Back To Top