WordPress.org

Forums

Insert PHP
[resolved] Pipe character error (5 posts)

  1. esilvas
    Member
    Posted 1 year ago #

    I have an error with some code being executed. When I use a pipe character | in my code as a delimiter, the code is displayed on the screen as text and not executed.

    For example:

    $variable = "1600 Pennsylvania Avenue, Washington, D.C. | 220 Main Building, Notre Dame, IN 46556";

    I tried escaping the character '\|', but that did not work. At this point, I am unsure if I can get around the problem. Do you have any suggestions?

    Thank you.

    https://wordpress.org/plugins/insert-php/

  2. WillBontrager
    Member
    Plugin Author

    Posted 1 year ago #

    Esilvas, substituting "|" for "|" should work.

    $variable = "1600 Pennsylvania Avenue, Washington, D.C. | 220 Main Building, Notre Dame, IN 46556";

    More info about using the pipe character at:

    http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#nonworkingelements

    Will

  3. WillBontrager
    Member
    Plugin Author

    Posted 1 year ago #

    Error in my previous response. The HTML entity was converted into the character.

    The first line of my previous response should read:

    Esilvas, substituting "& #124;" (no space between "&" and "#124;") for "|" should work.

    (It seems impossible to publish an HTML entity code without the entity being converted into the character in this support area, which is why the space after the & to get the code printed.)

    Will

  4. WillBontrager
    Member
    Plugin Author

    Posted 1 year ago #

    Because there has been no response, I'm assuming the original poster resolved the issue.

  5. esilvas
    Member
    Posted 1 year ago #

    Sorry, I have been working on other things over the weekend. Yes, this issue has been resolved. I appreciate the help. Thank you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Insert PHP
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic