Showing posts with label Alpha Space validation. Show all posts
Showing posts with label Alpha Space validation. Show all posts

Saturday 28 June 2014

How to generate passoword in php with specific length?

function generate_password( $length = 8 ) {
  $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  $password = substr( str_shuffle( $chars ), 0, $length );
  return $password;
 }

Wednesday 25 June 2014

Alpha Space Validation in JS

Enter text file allow allphabi & space only
function alpha_space_validation(arg){
 var valReg = /^[A-Za-z ]+$/;
 if(valReg.test( arg ) ) {
  return false;
 } else {
  return true;
 }
}