I am a web & mobile app developer based in Lahore. Since 2001, I have been developing creative, interactive, usable & successful web apps, web portals, php and Flash action scripting, REST apis, WordPress plugins & themes. In recent years, I have worked on Ionic + Angular hybrid mobile apps, Flutter & Dart, and native iOS mobile app development.

PHP Function to Clean Data before using in JavaScript or FBJS

Single quotes, double quotes, slashes and all kinds of other junk data will break your application code, especially the js and FBJS dialog boxes for sharing and components if the data is not cleaned properly. Following PHP function will clean your data for such garbage. function cleanData($data) { $cleaned = preg_replace(“/[^A-Za-z0-9\s\.\-\/+\!;\n\t\r]/”,””, $data); $cleaned = preg_replace(“/\s+/”,”…