Home arrow PHP arrow Page 7 - JVís Power Tips for PHP (2)
PHP

JVís Power Tips for PHP (2)


In this article Justin explores day to day programming techniques that can help to make a PHP developers life just that little bit easier.

Author Info:
By: Justin Vincent
Rating: 4 stars4 stars4 stars4 stars4 stars / 3
February 02, 2003
TABLE OF CONTENTS:
  1. · JVís Power Tips for PHP (2)
  2. · The Problem
  3. · Method 1
  4. · Method 2
  5. · Method 3
  6. · Method 4
  7. · Conclusion

print this article
SEARCH DEVARTICLES

JVís Power Tips for PHP (2) - Conclusion
(Page 7 of 7 )

This article has not been so much about showing you one way to do things, as it has been about adding new colours and concepts to your programming palette. Who knows? There may be a time in the future when you are presented with a problem and you think back to some of the concepts I described and realize they might just make your life a little bit easierÖ

The main concepts in bullet point:

  1. You can evaluate a single variable in an if statement (inc. arrays/objects)
  2. Abstract form input to protect against SQL injection
  3. Use {} so you donít have to break ďĎs when printing assigning variables.
  4. How to use array elements to decide what to display instead of if statements
  5. How to use & to shortcut to $_POST and make naming easier
  6. Create indexed arrays on the fly with []
  7. Create arbitrary arrays on the fly with [Ďanyí][Ďtextí]
  8. Using ?:; to determine dynamic content output
  9. Wrapping up ?:; in () like so (?:) for use within assignment or echo
  10. Using an array to store key values for use in conditional iteration
  11. Using foreach for easy iteration and value access
  12. Try not to use redundant code (i.e. donít write the same thing twice)
Once again I havenít covered as much ground as I would have liked. I guess that will just have to wait for the next instalment(s) of <announcers voice>JVís Power Tips For PHP</announcers voice>. I also have a website that offers, amongst other things, free scripts that can help to make a PHP programmerís job easier too.

Anyway, thanks for your time.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
PHP ARTICLES

- Removing Singletons in PHP
- Singletons in PHP
- Implement Facebook Javascript SDK with PHP
- Making Usage Statistics in PHP
- Installing PHP under Windows: Further Config...
- File Version Management in PHP
- Statistical View of Data in a Clustered Bar ...
- Creating a Multi-File Upload Script in PHP
- Executing Microsoft SQL Server Stored Proced...
- Code 10x More Efficiently Using Data Access ...
- A Few Tips for Speeding Up PHP Code
- The Modular Web Page
- Quick E-Commerce with PHP and PayPal
- Regression Testing With JMeter
- Building an Iterator with PHP

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials