Dear community,
for creating id/class names from field’s contents, I would like to replace all non-word-characters from a field with a hyphen.
I thought about something like:
<?php echo $testimonial->company()->lower()->str_replace('\W', '-') ?>
\W
meaning non-word-character in regular expression. I think such field methods don’t exist yet, do you think it’s a good idea to add a replace-method?
PS: I just discovered the escape method, maybe that’s a solution to this task, but I think replacing parts of field’s contents is a great feature. : )