-1

How to replace the comma separator with | for multiple categories in blog.

I need to change from:

Cat 1, Cat 2, Cat 3

to

Cat 1 | Cat 2 | Cat 3

I am using Elementor and the default blog.

Thanks!

androidism
  • 88
  • 9

1 Answers1

0

Just use php replace function

     <?php

echo str_replace(","," |","Cat 1, Cat 2, Cat 3");
?>

output is : Cat 1 | Cat 2 | Cat 3

Bhale Dino
  • 248
  • 2
  • 7
  • Please flag duplicate questions as duplicates instead of answering them. [The fundamental goal of closing duplicate questions is to help people find the right answer by getting all of those answers in one place.](https://stackoverflow.com/help/duplicates#:~:text=The%20fundamental%20goal%20of%20closing%20duplicate%20questions%20is%20to%20help%20people%20find%20the%20right%20answer%20by%20getting%20all%20of%20those%20answers%20in%20one%20place.) – mickmackusa Oct 30 '22 at 03:08