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
   

PHP ARTICLES

- 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...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap

Dev Shed Tutorial Topics: