#1 5 years ago

David Grudl
Administrator
Registered: 2005-02-08
Posts: 6126

Writing code in forum

While posting and replying, you can use Texy syntax to enhance your messages.

Code phrases can be surrounded by `backtick quotes`.

Long code blocks write this way:

/--php
function importFile($m)
{
    list(, $file) = $m;
    $level = substr_count($file, '/');
    echo "$file\n";
}
\--

or
/--
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule .* $0.php [L]
\--

It is possible to use <?php and ?> delimiters to indicate a PHP code:

<?php
function importFile($m)
{
    list(, $file) = $m;
    $level = substr_count($file, '/');
    echo "$file\n";
}
?>

JavaScript delimites are supported too (the type attribute is optional):

<script type="text/javascript">
function queryMark(url) {
  return (url.indexOf('?') == -1) ? '?' : '&';
}
</script>

 

Board footer