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

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
  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

JVís Power Tips for PHP (2) - Method 1
(Page 3 of 7 )

Anyway, back to the main point. We are in the middle of writing a script to test if the user has selected bold, italic etc. Here is the first (most basic) way of doing this:


  if ( $_POST['bold'] )
    $_POST['chat'] = "<b>{$_POST['chat']} </b>";

  if ( $_POST['italic'] )
    $_POST['chat'] = "<i>{$_POST['chat']}</i>";

  if ( $_POST['underline'] )
    $_POST['chat'] = "<u>{$_POST["chat']}</u>";

  if ( $_POST['strike'] )
    $_POST['chat'] = "<s>{$_POST['chat']}</s>";

  echo $_POST['chat'];


It's easy to see what is going on here. So I wonít say too much about it. Except that it is worth noting the variable $_POST['chat'] is within {}'s. This means you donít have to break the "'s with .s!
blog comments powered by Disqus

- 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 

Developer Shed Affiliates


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