Hi guys,
I was wondering if its possible with preg_replace to remove whitespace before and after a comma and limit words in a string to have atleast 3 letters?
Could I change the above string into this:
with preg_replace?
My current preg_replace looks like this:
Thanks for any help.
I was wondering if its possible with preg_replace to remove whitespace before and after a comma and limit words in a string to have atleast 3 letters?
Code:
this, is, a , test , string ,
Code:
this, is, a, test, string,
My current preg_replace looks like this:
PHP Code:
<?php
$string = 'this, is, a , test , string , ';
$string = preg_replace('/[^a-zA-Z0-9\s,]/', '', $string);
?>
Comment