php - preg_match function for checking currency Value -



php - preg_match function for checking currency Value -

i have values

£523.22 9454 ££45523 741.03 etc

i want remove £ value , check whether valid vaue or not can insert them database create next look help of preg_match() or similar function checking currency .y

$job_order=(preg_match("/^[£]*[0-9]*(.[0-9]*)?$/",$value) ? str_replace("£","",$value) : '' );

if $value =£523.22 homecoming null . if 741.03 thn working .i don't know whats wrong preg_match . m importing value .mer(merge) file.if write $value=£523.22 working when reads value file not identifying pound sign

you can utilize this:

$job_order = strtr($value, '£', ''); if (is_numeric($job_order)) { // valid } else { // invalid }

php regex preg-match

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -