This is a little code example that will validate an email address in two ways: - first the general syntax of the string is checked with a regular expression - then the domain substring (after the '@') is checked using the 'checkdnsrr' function function validate_email ( $email ){ $exp = "^[a-z\'0-9]+([._-][a-z\'0-9]+)*@([a-z0-9]+([._-][a-z0-9]+))+$" ; if( eregi ( $exp , $email )){ if( checkdnsrr ( array_pop ( explode ( "@" , $email )), "MX" )){ return true ; }else{ return false ; } }else{ return false ; } } ?>
Time Ago Function is a function that is commonly used to display time in human understandable format, as you have seen many times on social networks, whenever you post any status on your Facebook, Twitter or any other network, it says posted few seconds ago, 1 min ago, 1 hour age, etc. This is actually done by subtracting the current time from the post published time. //Creating Function function TimeAgo ( $oldTime , $newTime ) { $timeCalc = strtotime ( $newTime ) - strtotime ( $oldTime ) ; if ( $timeCalc >= ( 60 * 60 * 24 * 30 * 12 * 2 ) ) { $timeCalc = intval ( $timeCalc / 60 / 60 / 24 / 30 / 12 ) . " years ago" ; } else if ( $timeCalc >= ( 60 * 60 * 24 * 30 * 12 ) ) { $timeCalc = intval ( $timeCalc / 60 / 60 / 24 / 30 / 12 ) . " year ago" ; } else if ( $timeCalc >= ( 60 * 60 * 24 * 30 * 2 ) ) { $timeCalc = intval ( $timeCalc / 60 / 60 / 24 / 30 ) . " months ago" ; } else if ( $time...
If changing port number doesn't solve your problem, follow steps and this solves problem: (** By these steps don't need to reinstall Xampp or loss your database**) Stop all Xampp services and exit application. Move to c:\xampp\mysql Rename data folder to data_old create new data folder and copy whole content of backup folder to the data folder except "ibdata1" 5) Select all files in data_old folder and paste into data folder ( Note Don't replace copied files and skip replace theme).
Comments