PHP STRING FUNCTION WITH OUTPUT AND EXAMPLE
<?php
$var="my name is saddam hussain saifi ";
print_r(explode("a",$var)); //output:Array ( [0] => my n [1] => me is s [2] => dd [3] => m huss [4] => in s [5] => ifi )
echo crypt($varws);//output:-$1$m5/.1//.$KRawtTgnzzScShDJN3aHa.
echo crc32($var);//output:-1732983884
echo count_chars($var ,4);//output;-!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bcgjklopqrtvwxz{|}~€ ‚ƒ„…†‡ˆ‰Š‹Œ Ž ’“”•–—˜™š›œ žŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
echo convert_uuencode($var);//output:-@;7D@;F%M92!I
echo convert_uudecode($var);// output:d4P L@M
echo convert_cyr_string($var,'m','a');
echo chunk_split($var,2,"(sam)");//output:-my(sam) n(sam)am(sam)e (sam)is(sam) s(sam)ad(sam)da(sam)m (sam)hu(sam)ss(sam)ai(sam)n (sam)sa(sam)if(sam)i (sam)
echo chr(97);//a
echo chr(98);//b
echo chr(99);//c
echo chr(100);//d
echo chr(101);//e
echo $var."<br/>";
echo chop($var,"saifi");
echo bin2hex($var);//output:-6d79206e616d652069732073616464616d206875737361696e20736169666920
echo addslashes('What does "yolo" mean?');//output:-What does \"yolo\" mean?
echo addcslashes($var," "); //output;-my\ name\ is\ saddam\ hussain\ saifi\
echo stristr($var,"saifi");
$f="name";
echo substr_replace($var,"pappu",100);
$f="saifi";
echo str_replace($f,"pappu",$var);
echo str_repeat($var,10);
echo strpbrk($var,"h");
$var="abc";
echo $var=substr(str_shuffle($var),0,1);
echo strrev($var);
echo "<br/>";
echo $var;
echo substr($var,5);
echo substr($var,5,12);
$var1=strlen($var);
//echo substr_count($var ,"saifi");
echo str_pad($var , $var1 ,"<a href=' ".$var." '>".$var." ");
echo count_chars($var);
echo wordwrap($var,15,'<br/>');
echo $var1=str_word_count($var);
echo ucwords($var);
echo $var=strtoupper($var);
echo "<br/>";
echo lcfirst($var);
echo "<br/>";
echo $var=strtolower($var);
echo "<br/>";
echo ucfirst($var);
echo ltrim($var);
echo "<br/>";
echo trim($var);
echo "<br/>";
echo trim($var);
echo($var);
echo "<br/>";
print($var);
echo "<br/>";
printf($var);
echo "<br/>";
print_r($var);
?>
<?php
$var="my name is saddam hussain saifi ";
print_r(explode("a",$var)); //output:Array ( [0] => my n [1] => me is s [2] => dd [3] => m huss [4] => in s [5] => ifi )
echo crypt($varws);//output:-$1$m5/.1//.$KRawtTgnzzScShDJN3aHa.
echo crc32($var);//output:-1732983884
echo count_chars($var ,4);//output;-!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bcgjklopqrtvwxz{|}~€ ‚ƒ„…†‡ˆ‰Š‹Œ Ž ’“”•–—˜™š›œ žŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
echo convert_uuencode($var);//output:-@;7D@;F%M92!I
echo convert_uudecode($var);// output:d4P L@M
echo convert_cyr_string($var,'m','a');
echo chunk_split($var,2,"(sam)");//output:-my(sam) n(sam)am(sam)e (sam)is(sam) s(sam)ad(sam)da(sam)m (sam)hu(sam)ss(sam)ai(sam)n (sam)sa(sam)if(sam)i (sam)
echo chr(97);//a
echo chr(98);//b
echo chr(99);//c
echo chr(100);//d
echo chr(101);//e
echo $var."<br/>";
echo chop($var,"saifi");
echo bin2hex($var);//output:-6d79206e616d652069732073616464616d206875737361696e20736169666920
echo addslashes('What does "yolo" mean?');//output:-What does \"yolo\" mean?
echo addcslashes($var," "); //output;-my\ name\ is\ saddam\ hussain\ saifi\
echo stristr($var,"saifi");
$f="name";
echo substr_replace($var,"pappu",100);
$f="saifi";
echo str_replace($f,"pappu",$var);
echo str_repeat($var,10);
echo strpbrk($var,"h");
$var="abc";
echo $var=substr(str_shuffle($var),0,1);
echo strrev($var);
echo "<br/>";
echo $var;
echo substr($var,5);
echo substr($var,5,12);
$var1=strlen($var);
//echo substr_count($var ,"saifi");
echo str_pad($var , $var1 ,"<a href=' ".$var." '>".$var." ");
echo count_chars($var);
echo wordwrap($var,15,'<br/>');
echo $var1=str_word_count($var);
echo ucwords($var);
echo $var=strtoupper($var);
echo "<br/>";
echo lcfirst($var);
echo "<br/>";
echo $var=strtolower($var);
echo "<br/>";
echo ucfirst($var);
echo ltrim($var);
echo "<br/>";
echo trim($var);
echo "<br/>";
echo trim($var);
echo($var);
echo "<br/>";
print($var);
echo "<br/>";
printf($var);
echo "<br/>";
print_r($var);
?>
Comments
Post a Comment