Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6964767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:57:57+00:00 2026-05-27T15:57:57+00:00

Here is the code: if (isset($_POST[‘state’]) && count($err) > 0) { echo <p>; array_walk($err,

  • 0

Here is the code:

if (isset($_POST['state']) && count($err) > 0) {
    echo "<p>";
    array_walk($err, create_function('&$value', 'printf("$value<br />");'));
    echo "<br /><a href=\"/#contacto\">Volver</a></p>";
}

The problem:

The code works as expected, but it insists on printing linebreaks like <br>. Refusing to print them like <br />, as if it didn’t like the XHTML guidelines.
Any other forward slash / (in a closing tag) is printed correctly.

I have already tried nl2br() with the second parameter set to ‘true’. I’ve tried escaping them with a backslash \ (and then the backslash is printed but not the forward slash). I’ve tried escaping them with another forward slash (curiously enough it didn’t comment the rest of the line), and passed the strings through echo, printf, and trim to no avail.

Can anyone tell me what is going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:57:58+00:00Added an answer on May 27, 2026 at 3:57 pm

    To simplify your logic, you could just use:

    echo implode('<br />', $err);
    

    If you’ve tried all those techniques to no avail, are you sure there’s an issue with your code? Maybe you should try viewing your code using another browser, or even with some command-line tool such as curl:

    curl http://www.example.com/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code: if (isset($_POST['addmonths'])){ if (!empty($_POST['months'])){ if (is_numeric($_POST['months'])){ $monthtoadd = $_POST['months']; if
Here is my code: if (isset($_POST['addmonths'])){ if (!empty($_POST['months'])){ if (is_numeric($_POST['months'])){ $monthstoadd = $_POST['months']; if
Here is my code: if(isset($_POST['check']) AND $_POST['check'] == 'First') { $errormessage = array(); if(empty($_POST['full_name'])
here is the code <?php session_start(); if(!isset($_SESSION['user_name'])) { header('Location: login.php'); } $conn = mysql_connect(localhost,
Here's my code <form method=post action=<?php echo $_SERVER['PHP_SELF']; ?>> <input type=text name=text/> <input type=submit
Here's my code: <p>Select application status to view.</p> <form action=<?php echo $_SERVER['PHP_SELF']; ?> method=post>
I have this code to check that my ToS checkbox is checked: if (!isset($_POST['tosagree']))
Here's my code, for some reason, whether I specify a value for the input
Ok the error is showing up somewhere in this here code if($error==false) { $query
Here is code from MSDN . I don't understand why the work isn't just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.