you can place your php code into a new page block accessible by custom pages, see screenshots.
Please note, since this script uses a template system, it's impossible to output anything produced by your php code right into the browser using "echo()" aor anything similar. Instead, you should assign your output to a named macro. Like in this sample:
<?php
$myText = "Text output test";
$tpl->assign( "MY_PHPOUTPUT", $myText );
?>
And put that macro somewhere in your custom page.