C
C
Cheizer2021-05-30 20:16:56
PHP
Cheizer, 2021-05-30 20:16:56

How to remove parentheses and hyphens from a phone number on FENOM in MODX?

Greetings, there is a phone number +7 (903) 444-44-44
Before the output, I want to clean up the extra for whatsapp links, you need to remove spaces, parentheses and hyphens.

This is how I removed spaces, tell me how to remove parentheses and hyphens?
{1 | resource: 'phone'|preg_replace : '/\s+/': ''}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RacceGatel, 2021-05-31
@Cheizer

{1 | resource: 'phone'|preg_replace:'/[^0-9]|/': ''}

p.s. didn't check

B
bochkarev, 2021-06-03
@bochkarev

Cut out spaces from the phone

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question