Source code formatting in the old editor

For information on code formatting in the new editor, see Formatting text.

  • To highlight a source code snippet, such as a function name, in the text, wrap it in back quotes (`).

  • To format multiple source code lines, paste three back quotes (```) in the row preceding the code block and the row following the code block.

Example:

  •    Function `exit()`
    
    Result

    Function exit()

  •        Start of a code snippet
           ```
           <?
           phpinfo();
           $s = "Hello, World!\n";
           print $s;
           ```
           End of the code snippet
    
    
    Result

    Start of the code snippet

    <?
    phpinfo();
    $s = "Hello, World!\n";
    print $s;
    

    End of the code snippet

See also

Highlighting code syntax in the old editor