[Solved] what does || symbol means in Preg_replace() PHP [closed]


| separates alternatives in the regexp; e.g. /abc|def|ghi/ matches either abc, def, or ghi.

When you write 1st=||//e the resulting regexp will be /site||//e. Two of the alternatives are empty strings, which will match the empty strings before and after each character. So this will call phpinfo() for each character in $ka.

Actually, you should get an error because you have two / at the end of the regexp. It should be 1st=/e or 1st=||/e.

2

solved what does || symbol means in Preg_replace() PHP [closed]