Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

Make money selling software. Check this out here

Hosted clickbank mall. Check this out here




   Misc

   Amazon

   Links

    


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

 




   Sponsors
 

   Software
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

   Source Code
decimal to hexadecimal conversion function(Javascript)
This program deletes a folder(VB)
Create a text file(Powershell)
Messagebox in C(C)
Processor info(VB)
Odd or Even(ASP)
Cookies supported(ASP.net)
display the current timezone(VB)

    




Copyright © 2003 by programmershelp.co.uk