PHP Conference Kansai 2025

Voting

: min(nine, five)?
(Example: nine)

The Note You're Voting On

www.phella.net
17 years ago
When you quote highlighted PHP code in your website you need to escape quotes. If you quote a lot it may be annoyning. Here is tiny snippet how to make quoting tidy and clean. Write your code like this:

<?code()?>
$string = 'Here I put my code';
<?code()?>

And somewhere else define the function:

<?
function code()
{
static $on=false;
if (!$on) ob_start();
else
{
$buffer= "<?\n".ob_get_contents()."?>";
ob_end_clean();
highlight_string($buffer);
}
$on=!$on;
}
?>

<< Back to user notes page

To Top