Posted by Toby A Inkster on 04/18/07 07:30
Rami Elomaa wrote:
> <?php
> $i++;
> if($i<10) xyz (__FILE__) ;
> else echo $i;
> ?>
>
> Substitute xyz with a standard function or construct so that the output
> is 10.
My immediate thought would be...
<?php
$i++;
if($i<10) echo preg_replace('/[^\d]/','',file_get_contents(__FILE__));
else echo $i;
?>
--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
Navigation:
[Reply to this message]
|