Comment on Code that will only execute onceComments−rokhayakebe12y1) Create a file unlink.php in your php environment2) Paste this in it <?php unlink('unlink.php');3) Visit unlink.php on your browser−hueving12yAny php file with the following should work.<?php unlink(__FILE__);−leepowers12yWith short open tags enabled the example can be simplified further as <?unlink(__FILE__);−MattBearman12yIt's been a couple of years since I programmed in PHP, but I'm pretty sure if it's the EOF you don't even need the final semicolon, so: <?unlink(__FILE__)−dylz12yShort tags (other than echo <?=) are no longer on by d efault−erikano12yVisit unlink.php on your browserBetter yet, make it an executable script starting with the line:#!/usr/bin/php -q
Comments
1) Create a file unlink.php in your php environment
2) Paste this in it <?php unlink('unlink.php');
3) Visit unlink.php on your browser
Any php file with the following should work.
<?php unlink(__FILE__);
With short open tags enabled the example can be simplified further as <?unlink(__FILE__);
It's been a couple of years since I programmed in PHP, but I'm pretty sure if it's the EOF you don't even need the final semicolon, so:
Short tags (other than echo <?=) are no longer on by d efault
Better yet, make it an executable script starting with the line:
#!/usr/bin/php -q