I want to check what has been posted from my form to see if it is in the correct format to go into my database. My mysql field is set up to be decimal(6,2)

    you should be able to use preg_match w/ the following regex.

    $num = '123123.45';
    $exp = '/^\d{6}+\.\d{2}$/';
    
    if(preg_match($exp,$num)){
    	echo  'TRUE';	
    }else{
    	echo 'FALSE';
    }
    
    
    

    HTH

      Write a Reply...