It return a formatted string
Example
<?php
echo vsprintf(“%s %s”,array(“php”,”code”));
?>
Output
php code
It return a formatted string
Example
<?php
echo vsprintf(“%s %s”,array(“php”,”code”));
?>
Output
php code
It output a formatted string
Example
<?php
vprintf(“%s %s”,array(“php”,”code”));
?>
Output
php code
It writes a formatted string to a specified output stream
Example
<?php
$file = fopen(“test.txt”,”w”);
echo vfprintf($file,”%s%s”,array(“PHP”,”Code”));
?>
Output
7
It converts the first character of each word in a string to uppercase
Example
<?php
echo ucwords(“php code”);
?>
Output
Php Code
It make a string’s first character uppercase
Example
<?php
echo ucfirst(“phpcode”);
?>
Output
Phpcode
It strips whitespace from the beginning and end of a string
Example
<?php
echo trim(” php code “);
?>
Output
php code
It returns part of a string
Example
<?php
echo substr(“phpcode”,2,4);
?>
Output
pcod
It replace text within a portion of a string
Example
<?php
echo substr_replace(“php code”,”codez”,4);
?>
Output
php codez
It counts the number of substring occurrences
Example
<?php
echo substr_count(“phpcode. phpcodez”,”code”);
?>
Output
2
It compares two strings from a specified start position
Example
<?php
echo substr_compare(“phpcodexc”,”phpcode”,0);
?>
Output
2