Replace string php element validation

Status
Not open for further replies.

nycreate

Member
Hi All..

A quicky for anyone vaguely more intelligent than me..

I have a number entered into a field.....

when another field is set to a certain value I want to replace the last few characters with ****.

Condition im ok with but the php im thick

field value will be say '12345678' and I want to replace it with '1234****'

Thanks in advance.
 
Something like
$s = substr($data,0,-4).'****';
return $s;

Length of $data has to be >4 or you have to evaluate the length and use it.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top