hi,
it's really late and i'm struggling with this one - so any help gratefully
received.
if i have a string how would i strip out all characters except letters
between a-z and A-Z
i presume this would be using preg_grep but not being a regex guru is making
it hard.
would it be something like?
$subject = "abc-d%ef"; // Want i want to get back is 'abcdef'
$pattern = '/[a-zA-Z]*/';
preg_match($pat tern, $subject, $matches);
// print_r($matche s);
$cleaned_word = matches[0];
thanks,
kev
it's really late and i'm struggling with this one - so any help gratefully
received.
if i have a string how would i strip out all characters except letters
between a-z and A-Z
i presume this would be using preg_grep but not being a regex guru is making
it hard.
would it be something like?
$subject = "abc-d%ef"; // Want i want to get back is 'abcdef'
$pattern = '/[a-zA-Z]*/';
preg_match($pat tern, $subject, $matches);
// print_r($matche s);
$cleaned_word = matches[0];
thanks,
kev
Comment