I was browsing around the PHP online manual (the single best resource for learning about PHP) and I came up with several things that I didn't know about that were pretty interesting.
- Alternate syntax for control structures (if, while, etc)
<?php $a = "b"; if($a == "a"): ?> a = a <?php elseif($a == "b"): ?> a = b <?php else: ?> a = ? <?php endif; ?>
- Changing modified and accessed time of a file
touch("fake.txt", time()-1*60*60*24*365, time()-1*60*60*24*365); - Highlighting a file for PHP syntax with one line
highlight_file('file.php');
Actually, I already knew about all of these, I just wanted to share ![]()




October 16th, 2007 at 10:46 pm
nice tips! I especially like the modifying the access time and modified time.. and didn't know about the highlight_file one… dugg!
October 17th, 2007 at 5:52 pm
Thanks, man, glad you found something useful