Latest 'ITTreats'
- Microsoft Tech
- SUN Tech
- Open Sources
- Databases
- Software Testing
- Others
Trimming Completely using PHP Regular expressions
Hello Friends,
Is your Trimming method is taking care for special characters ? you might be using some trimming for some of the special characters but what about the rest ? for you here is a simple Function which will trim the string entirely and results only the pure string
function pureTrim($input) { // This allows Only Alphabets Numerals and Space $output = preg_replace("/[^a-z0-9\s]/i", " ", $input); $output= trim($output); return $output; }
So, try using this function your code . Hope this will help you




