Enter Keyword Hear for Search This Blog

Saturday, 23 April 2016

String function in php

echo

<?php
echo " A value is ";
$a=4;
echo $a;
?>


chr

<?php
echo chr(65);
echo "<br/>";
echo chr(122);
?>


strlen

<?php
$pwd="abc@123";
if(strlen($pwd)<6)
{
echo "password to short";
}
?>


ord

<?php
echo ord(' ');
echo "<br/>";
echo ord('z');
?>

print

<?php
print " A value is ";
$a=4;
print $a;
?>

strtoupper

<?php
echo strtoupper('hello');
echo "<br/>";
echo strtoupper('world');
?>

strtolower

<?php
echo strtolower('HEllo');
echo "<br/>";
echo strtolower('WORLD');
?>


substr

<?php
$a="harsukh k k";
$b=strlen($a);
for($i=0;$i<=9;$i++){
$j=substr($a,$i,1);
$d=ord($j);
echo $d;
echo"<br />";
echo $j;
}


?>

chop

<?php
     $str = "Hello World!";
     echo $str . "<br>";
     echo chop($str,"World!");
?>

join

<?php
$arr = array('Hello','World!','Beautiful','Day!');
echo join(" ",$arr);
?>

parse_str

<?php
parse_str("name=Peter&age=43");
echo $name."<br>";
echo $age;
?>

3 comments:

Unknown said...

Wonderful post.Thanks for sharing this information to my vision which was very informative.
Php Developers Chennai | Php Developers India


Anoushka Sakthi said...

PHP – Hypertext preprocessor is a general purpose scripting language specially designed for the web development that is easily embedded into HTML language. Some of the excellent features in PHP include capability to create dynamic page content, send and receive cookies, encrypt data.
Regards:
PHP Training in Chennai | PHP Course in Chennai

cbrdrive said...

Thnx tra yu

Featured post

what is ajax?how to create ajax with php code

Ajax Introduction -  એજેક્સ નો ઉપીયોગ કરી ને તમે પેજ લોડ કાર્ય વિના બધી માહિતી મેળવી શકો.એજેક્સ થી તમે કોઈ પણ ડેટા ઝડપ થી મેળવી શકો છો...