Archive for June, 2007

php – ucfirst

php – ucfirst

ucfirst — Make a string’s first character uppercase

string ucfirst ( string $str )

<?php
$test = ‘to funny!’;
$test = ucfirst($test); // To funny!

$test1 = ‘tofunny!’;
$test1 = ucfirst($test1); // Tofunny!
?>

Advertisements

Leave a Comment

php – wordwrap function

wordwrap

(PHP 4 >= 4.0.2, PHP 5)

wordwrap — Wraps a string to a given number of characters using a string break character

<php
$text = “bodyguard bodyguard training security seminars”;
$newtext = wordwrap($text, 10, “<br />\n”);

echo $newtext;
?>

Out put will be:

bodyguard <br />
bodyguard <br />
training s <br />
ecurity sem <br />
inars

Leave a Comment