Jump to content

PHP Tips: random facts


chmpdog

Recommended Posts

Hi, I don't really have a question, but I wanted to learn about php. I am pretty good at the language but I wanted to start a topic about random facts that I might have missed.

 

So post a random php fact / hint that you think is unique.

 

Here I'll go first:

"Regex for email validation can sometimes return on valid email addresses."

Link to comment
https://forums.phpfreaks.com/topic/165890-php-tips-random-facts/
Share on other sites

Random fact: PHP has a manual, it's good, and it probably answers your question.

 

:rtfm:

 

Edit: Who the hell added a word filter for r_tfm (excluding underscore) to "read the manual"? I'll have to go fix that...

 

Edit 2: Better, but pretty stupid that SMF parses word filters before smileys.

here's a tip:

 

typing http://www.php.net/functionhere

 

will take you to the manual entry of the function (or a list of suggestions if you misspelled it or suggestions of something that might be useful)

 

Also I don't think a whole lot of people here know that you can do

 

[m]function[/m]

 

on these boards and it will auto-link to the manual.

here's a tip:

 

typing http://www.php.net/functionhere

 

will take you to the manual entry of the function (or a list of suggestions if you misspelled it or suggestions of something that might be useful)

 

Also I don't think a whole lot of people here know that you can do

 

[m]function[/m]

 

on these boards and it will auto-link to the manual.

 

str_rot13 Test :P

 

---

Edit - W00T! :o Thats gonna save me alot of time, I've been doing

 

[url=http://php.net/funcname]funcname()[/url] 

"Regex for email validation can sometimes return on valid email addresses."

 

:-\  Sometimes eh? Speaks volumes of the regex pattern in question if that's the case.

 

Here's my contribution:

 

$facts = array('In their first year of life, puppies grow 10 times faster than human infants do.',
	'Heavy thought: The world\'s termites outweigh the world\'s humans 10 to 1.',
	'Eagles see better than humans on clear days. Humans see better than eagles on foggy days.',
	'Rule of thumb: Nearly all boys grow at least as tall as thier mothers.',
	'Only 48% of the sun\'s energy actually reaches the earth.',
	'Elephants can\'t jump. Every other mammal can.',
	'Circus clowns have a "Face Registry" to prevent other clowns from plagiarizing their faces.',
	'Hair grows at a rate of .00000001 miles per hour.'
    ); // facts from 'The Best of Uncle John's Bathroom Reader

echo $facts[mt_rand(0,7)];

 

It's random facts, and it involves PHP.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.