What is the space character for the browser?

Posted by Hiro Protagonist on Stack Overflow See other posts from Stack Overflow or by Hiro Protagonist
Published on 2012-06-03T22:24:12Z Indexed on 2012/06/03 22:40 UTC
Read the original article Hit count: 256

Filed under:
|
echo "\n\s\s\s\s\s\s" . "<div id='data-load' data-load='" . $load . "'></div>";

\n works for adding a return in...I tried \s logically for space but this does not work.

Keep mind, I don't want this rendered in the browser view...but in the source view ( when you click view->source )...I'm trying to put my html in to a readable form.

    echo "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" . "<div id='data-path' data-path='" . $path . "'></div>";

This does not work either. I am composing HTML from PHP...

echo "      \n" . "<div id='data-load' data-load='" . $load . "'></div>";

This does not work either.

Actual Code:

public static function setUniversals()
{
    $shared_object = new Shared();
    if ( $shared_object->getLoadOn() == 1 )
    {
        $load = 'server';
    }
    else
    {
        $load = 'client';
    }
    if( getcwd() === '/home/foo/public_html/develop' )
    {
        $path = 'development';
    }
    else
    {
        $path = 'production';
    }
    $shared_object = new Shared();
    echo "\n";
    echo "\n      " . "<div id='data-path' data-path='" . $path . "'></div>";
    echo "\n      " . "<div id='data-load' data-load='" . $load . "'></div>";
}

© Stack Overflow or respective owner

Related posts about php

Related posts about html