0

My goal is to store a newline character in an array. I want to display it later on a site.

$settings['standard'] = array(
            'title'       => __( 'Standard', 'foo' ),
            'description' => __( 'description text with 
newline character', 'fooMore' ));

the output have to something like this:

description text with
newline character

1
  • 1
    if showed inside a html element why not use old <br> ? Commented Jan 28, 2015 at 10:21

1 Answer 1

4
$settings['standard'] = array(
        'title'       => __( 'Standard', 'foo' ),
        'description' => __( 'description text with' . PHP_EOL . 'newline character', 'fooMore' ));

PHP_EOL is the End Of Line character for your current environment (LF, CR or CRLF).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.