Programming Basics
  Home arrow Programming Basics arrow PHP Strings Primer
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Forums Sitemap 
Dedicated Servers  
Download TestComplete 
IBM® developerWorks
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PROGRAMMING BASICS

PHP Strings Primer
By: Matt Wade
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2003-07-11

    Table of Contents:
  • PHP Strings Primer
  • The Basics
  • Single Quotes
  • Double Quotes
  • Heredoc
  • Concatenation
  • Displaying Strings
  • echo
  • print
  • printf
  • Strings Formatting
  • Preparing user input for comparisons
  • Capitalization
  • Reversing strings
  • Padding strings
  • Multiple Lines
  • Data Preparation
  • Adding and Removing Slashes
  • Dealing with HTML Tags and Entities
  • Counting
  • Checking password strength
  • Generating Statistics
  • Substrings (and searching)
  • Extracting Substrings
  • Counting Paragraphs
  • Filtering Words
  • Working with email addresses
  • Manually Stripping Tags
  • Password Strength Revisited
  • Handling URLs and Base64-encoding
  • Parsing URLs
  • Encoding for URLs
  • Encoding for Email
  • Hashing
  • Verifying Integrity
  • User Authentication
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    PHP Strings Primer


    (Page 1 of 37 )

    In order to accomplish almost any programming task with PHPyou'll be dealing with strings. To get the best out of PHP you must thoroughlyunderstand the basic string functions available. In this tutorial we will laydown the foundations needed for a solid understanding of strings.

    In order to accomplish almost any programming task with PHP you'll be dealing with strings. To get the best out of PHP you must thoroughly understand the basic string functions available. In this tutorial we will lay down the foundations needed for a solid understanding of strings. As we examine a multitude of basic string functions, we will focus in on specific uses for each and show examples of how many of these functions can be used together. This tutorial will start with the very basic use of a string in PHP and build upon that base knowledge by showing you specific functions and how they can be used together.

    Throughout this tutorial, we will divide the large number of string functions available with PHP into several areas of string functions.

  • The Basics -Here we will look at the difference between single quotes and double quotes. We'll also look the heredoc syntax and string concatenation.
  • Displaying -In this section we will examine the three most common methods of displaying string -echo, print, and printf.
  • Formatting -Different methods of formatting strings such as changing capitalization, controlling line breaks, and removing excess white space.
  • Data Preparation -Here we will explore ways to prepare data for display or storage in a database.
  • Counting -This section will provide you with ways to count characters in a string, check string length, and determine the number of words in a string.
  • Substrings -In this section we will look at techniques for working with substrings. We will show you ways to locate a substring and replace portions of a string.
  • URLs and Base64 -Here we will examine how to deal with URLs and parse them into their separate parts and also how to encode them properly. We will also see how to prepare binary data for transmission through email.
  • Hashing -In this section we will discuss how to use hashing to perform user authentication and to validate the integrity of data.

    Upon completion of this tutorial, you will have garnered an excellent understanding of the basic use of strings and how to draw on that knowledge for practical situations.

    More Programming Basics Articles
    More By Matt Wade


       · comment
       · really goood work ,it covers all the major string functions.also explained with...
       · test'ng
     

  • PROGRAMMING BASICS ARTICLES

    - Loops and PHP Decision Making
    - Operators, Conditionals, and PHP Decision-Ma...
    - PHP Decision-Making
    - Coding
    - Server Statistics
    - Looping in PHP
    - Cookies in PHP
    - Working with text files
    - Beginning Object Oriented Programming in PHP
    - A Tour of Decision Making Structures in PHP
    - PHP Strings Primer
    - PHP Control Structures
    - Intro to Vim
    - Reading Directorys with PHP
    - An Overview of Arrays in PHP






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway