• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Script Editing "eats" backslash

Script Editing "eats" backslash 12 years 5 months ago #15495

  • s31523
  • s31523's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 25
I am trying to use the script called on process tab to parse a text field to replace \n characters to <br>. I added the following code, which works:
$test = preg_replace("/\\n/","<br>", $ingredients_local);

I save the code, then go back and edit, and the code looks like this:
$test = preg_replace("/\n/","<br>", $ingredients_local);

Again, if I save and go back the code changes:
$test = preg_replace("/n/","<br>", $ingredients_local);

With each edit, another backslash is eaten. I am sure I am not doing something right, i.e. do I need to canonicalize the string? Has anyone encountered this, and if so, how did you get it to work?

Thanks!
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!