Skip to main content

PHP STRING FUNCTION WITH OUTPUT AND EXAMPLE

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);


?>

Comments

Popular posts from this blog

how send mail using Swift mailer | switmailer send mail tutorial

how send mail using Swift mailer | switmailer send mail tutorial  <?php /* step 1 include Swift mailer file ;  */ include("vendor/swiftmailer/swiftmailer/lib/swift_required.php"); /* step 2 create your user details */ $senderEmail="saddam1234321@gmail.com"; $senderPassword="****Your password****"; $senderName="Saddam huassin"; /* step 3 set SMTP host  for sending mail  */ $user = Swift_SmtpTransport::newInstance('smtp.gmail.com','587','tls'); /* step 4 set your user details  */ $user->setUsername($senderEmail); $user->setPassword($senderPassword); /* step 5 create swift  mailer instance with a variable */ $mailer = Swift_Mailer::newInstance($user); /* step 6 Create a message */ $message = Swift_Message::newInstance('Wonderful Subject')   ->setFrom(array($senderEmail => $senderName))   ->setTo(array($senderEmail))   ->setBody('Here is the message itsel...

how install Swift mailer in localhost | swift mailer installation | composer install swift mailer

how install Swift mailer in localhost | swift mailer installation | composer install swift mailer Step 1:- open cmd  Step 2;- copy this command " composer required swiftmailer/swiftmailer @stable " . Step 3;- paste in cmd and press enter. Step 4;- after few second swift mailer ready to use .................................