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']), Link to comment https://forums.phpfreaks.com/topic/156453-solved-replace-with/ 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']) Link to comment https://forums.phpfreaks.com/topic/156453-solved-replace-with/#findComment-823770 Share on other sites More sharing options...
inferium Posted May 1, 2009 Author Share Posted May 1, 2009 Sweet, thanks a bunch! Link to comment https://forums.phpfreaks.com/topic/156453-solved-replace-with/#findComment-823775 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.