programmingsite : code , tutorials and scripts
Navigation

home


ASP
ASP.net
C
C++
C#
PHP
Java
JavaScript
Powershell
VB.net

Visual Basic


Resources
code
tutorials
training

Ads
Products

 

 

A look at string functions part 1




A look at string functions part 1

We will look at some of the basic string functions here first , we will cover the changing of case of a string or part of a string . Here are the fuctions that we will cover.

strtolower() : This converts a string to lower case

strtoupper() : This converts a string to upper case

ucfirst() : This capitalizes the first letter of a string as long as it is alphabetic

ucwords() : This capitalizes the first letter of each word in a string that begins with an alphabetic letter

Lets look at an example that demonstartes these functions.


<?php
$test_string = "This is our TEST string";
echo $test_string . "<br>"; //test string
echo strtolower($test_string) . "<br>"; // convert to lower case
echo strtoupper($test_string) . "<br>"; //convert to upper case
echo ucfirst($test_string) . "<br>"; //first letter in string capitalized
echo ucwords($test_string) . "<br>"; //first letter in each word capitalized
?>

And here it is in action



This is our TEST string
this is our test string
THIS IS OUR TEST STRING
This is our TEST string
This Is Our TEST String




Products
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals
Asp Studio 2005
Xtra PHP
Online PHP Script Encoder
Comparison

Links
Make money selling software
Uk shopping
UK price comparison
US price comparison
free articles
free stuff
Gambling resources
Software directory
XBox cheats and more
Sexy free wallpapers
Hosting resources
Nintendo Wii info
Beginners PHP
Health and fitness
Domain names
Dating site
Nintendo DS resources
Dropshippers
Maxi directory
Perfume and fragrances
PC shopping, tips and info
Magazine superstore

Ads