String Manipulation
1. Changing Case
<?
$full_name = 'nicholas cage';
$full_name = ucwords($full_name);
echo $full_name;
// Use strtolower and strtoupper functions too
?>
2. Trimming White Space
<?
trim(" Test "); // Remove white space from both sides of a string
ltrim(" Test "); // Remove white space from left side of a string
rtrim(" Test "); // Remove white space from right side of a string
?>
3. Shuffle characters
<?
$full_name = 'nicholas cage';
$full_name = str_shuffle($full_name);
echo $full_name;
?>
4. Finding String Positions with strpos
<?
$full_name = "nicholas";
$letter_position = strpos($full_name,"h");
echo $letter_position;
?>
5. Splitting a line of text
<?
$full_name = "Jaydra,Joe,Elizabeth,Abby,Vilma,Laura";
$names = explode(",",$full_name); // Returns an array by breaking string with "," sign
echo $names[0];
?>
Php Discussion
- - PHP 4 or 5 as a Deploymen
- - How do I decode a html/ph
- - PHP help
- - What is wamp?
- - How to execute a php file
Php Source Code
- - Wraps A String To A Given
number Of Characters Using A
string Break Character - - Uppercase The First Character
of Each Word In A String - - Make A String's First Character
uppercase - - Strip Whitespace (or Other
characters) From The Beginning
and End Of A String - - Return Part Of A String



