inferium Posted May 1, 2009 Share Posted May 1, 2009 Hey all, So I have this problem. I've got a program set up that sends out data to another system, and we have to convert it a certain way to where theirs will accept it. Now, the only piece of information that isn't sending correctly is the 'dob'. I need the dashes in the birthdate (it's in our system as mm-dd-yyyy) to be replaced with dashes. How could I alter the following code to allow me to do this. Thanks in advance!!! 'work_phone' => preg_replace('/[^0-9]/i','',$value['leadWorkPhone']), 'email' => $value['leadEmail'], 'ssn' => preg_replace('/[^0-9]/i','',$value['leadSSN']), 'dob' => preg_replace('/[^0-9]/i','',$value['leadBirthdate']), Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 1, 2009 Share Posted May 1, 2009 'dob' => preg_replace('/[^\d-]/i','',$value['leadBirthdate']), ? Edit: if you want to replace "-" with "/", then: str_replace('-', '/', $value['leadBirthdate']) Quote Link to comment Share on other sites More sharing options...
inferium Posted May 1, 2009 Author Share Posted May 1, 2009 Sweet, thanks a bunch! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.