Home arrow PHP arrow Page 5 - PHP 101 (part 5) - The Wonderland Factor

Q&A - PHP

This concluding article in the series illustrates PHP's filefunctions, with examples of how to read and write files on the system. Italso includes an explanation of user-defined functions, return values andfunction arguments, together with some not-so-real-life examples.

TABLE OF CONTENTS:
  1. PHP 101 (part 5) - The Wonderland Factor
  2. So Who Are You, Anyway?
  3. Graffiti For The Masses
  4. Calling Godzilla
  5. Q
  6. Arguments And Responses
  7. The Wonderland Factor
By: Vikram Vaswani and Harish Kamath, (c) Melonfire
Rating: starstarstarstarstar / 7
September 06, 2000

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
How about an example?


<html> <head> <basefont face=Arial> </head> <body> <?php function answer_yes() { echo "Yes!"; } function answer_no() { echo "No!"; } ?> Would you watch an Al Pacino movie without thinking twice? <br> <? answer_yes(); ?> <p> Does 2 + 2 equal 6? <br> <? answer_no(); ?> <p> Is this the coolest PHP tutorial on the planet? <br> <? answer_yes(); ?> </body> </html>
And here's the output:

Would you watch an Al Pacino movie without thinking twice? Yes! Does 2 + 2 equal 6? No! Is this the coolest PHP tutorial on the planet? Yes!
You can also invoke a function before it's been defined.

<html> <head> <basefont face=Arial> </head> <body> Would you watch an Al Pacino movie without thinking twice? <br> <? answer_yes(); ?> <p> Does 2 + 2 equal 6? <br> <? answer_no(); ?> <p> Is this the coolest PHP tutorial on the planet? <br> <? answer_yes(); ?> <?php function answer_yes() { echo "Yes!"; } function answer_no() { echo "No!"; } ?> </body> </html>


 
 
>>> More PHP Articles          >>> More By Vikram Vaswani and Harish Kamath, (c) Melonfire
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: