Select Git revision
inc_functions.php
inc_functions.php 1.29 KiB
<?php
function getOutput($sPhpcode){
global $renderAdminLTE;
$sOut = '';
eval("\$sOut=$sPhpcode;");
return $sOut;
}
function showExample($sPhpcode){
// global $renderAdminLTE;
$sOut = getOutput($sPhpcode);
return '
<table class="table">
<thead>
<tr>
<th>Source</th>
<th>Output</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<pre class="highlight">'.
str_replace(
['array (', '))'],
['array (<span class="params">', '</span>))'],
htmlentities($sPhpcode))
.'</pre>
</td>
<td>
'.$sOut.'<br><br>
<pre>'.
str_replace(
['>', '<'],
['><span class="output">', '</span><'],
htmlentities(str_replace([">", "</", "\n\n" ], [">\n", "\n</", "\n"], $sOut))
)
.'</pre>
</td>
</tr>
</tbody>
</table>
';
}