Php String Function

String Function

<?php

echo '<br>Addslashes<br>';
$str="This is Line's";
print_r(addslashes($str));

echo '<hr>';

echo '<br>Stripslashes<br>';
$str="This is Line's";
print_r(stripslashes($str));

echo '<hr>';

echo '<br>HTMLEntities<br>';
$str="This is <b>Line's</b>";
print_r(htmlentities($str));

echo '<hr>';

echo '<br>HTMLSpecialChars<br>';
$str="This is <b>Line's</b>";
print_r(htmlspecialchars($str));

echo '<hr>';

echo '<br>md5<br>';
$str="pass123";
print_r(md5($str));

echo '<hr>';

echo '<br>base64_encode<br>';
$str="pass123";
$str1=base64_encode($str);
print_r(base64_encode($str));

echo '<hr>';

echo '<br>base64_decode<br>';
$str="pass123";
print_r(base64_decode($str1));

echo '<hr>';


echo '<br>urlencode<br>';
$str="http//:www.facebook.com";
$str1=urlencode($str);
print_r(urlencode($str));

echo '<hr>';

echo '<br>urldecode<br>';
print_r(urldecode($str1));

echo '<hr>';

echo '<br>strlength<br>';
$str="this is a line";
print_r(strlen($str));

echo '<hr>';

/*echo '<br>n12br<br>';
$str="hello word";
print_r(n12br($str));

echo '<hr>';
*/
echo '<br>number_format<br>';
$str="12.76888888";
print_r(number_format($str,2));

echo '<hr>';

echo '<br>str_replace<br>';
$str="hello word";
print_r(str_replace("hello","hi",$str));

echo '<hr>';

echo '<br>str_word_count<br>';
$str="hello word";
print_r(str_word_count($str));

echo '<hr>';

echo '<br>str_repeat<br>';
$str="*";
print_r(str_repeat($str,10));

echo '<hr>';

/*echo '<br>shuffle<br>';
$str="this is a line";
echo shuffle($str);

echo '<hr>';
*/

/*echo '<br>md5_file<br>';
$str="c:/wamp/array";
print_r(md5_file($str));

echo '<hr>';*/

echo '<br>strtoupper/strlower<br>';
$str="this is a line";
$rst=strtoupper($str);
print_r(strtoupper($str));
print_r(strtolower($rst));
echo '<hr>';

echo '<br>ucwords<br>';
$str="this is a line";
print_r(ucwords($str));
echo '<hr>';

echo '<br>ucfirst<br>';
$str="this is a line";
print_r(ucfirst($str));
echo '<hr>';

?>



Explore Our YouTube Tutorials

Dive into our YouTube tutorials to access high-quality learning content on web development, design, and technology. Each video is crafted to provide clear guidance and hands-on knowledge for skill development.

 


Upgrade Your Skills with Our Courses

Choose the right course and start building your future with practical skills.

Web Development

Learn HTML, CSS, JavaScript, and PHP to build modern, responsive websites and real-world projects.

Enroll Now See Full Details

Breadboard Learning

Understand electronics basics with hands-on breadboard projects and circuit building techniques.

Enroll Now See Full Details

AI Training

Step into AI with real-world applications, automation tools, and smart development techniques.

Enroll Now See Full Details