suresh64633 Posted September 1, 2009 Share Posted September 1, 2009 Hello Guys, Am importing CSV files which contain amount field and it working fine. If values are lilke 309, 139, 1, "EB", "83553.12","CAAXX", If my CSV contain amount fields like 309, 139, 1, "EB", "83,553.12", "CAAXX", Than it take to different values as 83 and 533.12. How to overcome this problem? Quote Link to comment https://forums.phpfreaks.com/topic/172696-solved-csv-importing/ Share on other sites More sharing options...
ignace Posted September 1, 2009 Share Posted September 1, 2009 Is it possible to change the value-separator? Thus instead of , use ;? Otherwise you could use: $values = array(); preg_match('/\d+|"[A-Z-,-\.-0-9]+"/', $csvline, $values); print_r($values); Quote Link to comment https://forums.phpfreaks.com/topic/172696-solved-csv-importing/#findComment-910294 Share on other sites More sharing options...
suresh64633 Posted September 1, 2009 Author Share Posted September 1, 2009 Thanks for your fast replay. And it working great. Quote Link to comment https://forums.phpfreaks.com/topic/172696-solved-csv-importing/#findComment-910315 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.