Using preg_replace () in PHP, I came across the following situation:
echo preg_replace('/:([\w]+)/', 'batata', ':quiabo/isso/:nada');
echo preg_replace('@:([\w]+)@', 'batata', ':quiabo/isso/:nada');
Both expressions print the same thing: potato / this / potato
From this I have two doubts:
1 - Why do we need to use '/' or '@' at the beginning of the pattern?
2 - What's the difference between using '/' or '@' in this same situation?