<?php


$strings = "^^^^^Sudhir Gour";

// ltrim
// echo ltrim($strings , "^");
// trim 
$strings = "******Sudhir ** Gour**";
// echo trim($strings , "*");
// rtrim 
// echo rtrim($strings , "*");

// str_contains() 
// var_dump(str_contains($strings , "Gour")); // true
// var_dump(str_contains($strings , "Kumar")); // false

// str_ends_with() : 
// var_dump (str_ends_with($strings , "**"));
// var_dump(str_ends_with($strings  , "our"));



// str_starts_with() : 
// var_dump (str_starts_with($strings , "vvv"));
// var_dump (str_starts_with($strings , "**"));


// str_replace() : 
// var_dump(str_replace("Sudhir" , "Samay" , $strings));


// str_shuffle() :
// echo str_shuffle($strings);


// str_split() : 
// print_r(str_split($strings , 3));

// str_word_count() : 
// print_r(str_word_count($strings));


//// IMPORTANT : strip_tags() : 
$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
// print_r(strip_tags($text));

// strpos()  :
// echo strpos($strings , "Our"); // returns nothing
// echo strpos($strings , "our"); // returns 17

// strtolower() : 
// echo strtolower($strings);

// ucfirst() :
// echo ucfirst($strings);

// ucwords() : 
$strings = "this is a string with all words in lowercase";
// echo ucwords($strings);

// strtoupper() : 
// echo strtoupper($strings);

// substr() : 
// echo substr($strings , 3);

// str_ireplace() : 
// echo str_ireplace("LOwercase" , "uppercase" , $strings);
// echo $strings;


// str_pad() :
// echo str_pad($strings , 55 , "&");
// echo str_pad($strings , 55 , "$" , STR_PAD_LEFT);
// echo str_pad($strings , 55 , "$" , STR_PAD_BOTH);


// strcasecmp() :

// echo (strcasecmp("Sudhir" , "gour")); // Returns alphabetical position of first unequal character of first argument
// Returns -1 if string1 is less than string2; 1 if string1 is greater than string2, and 0 if they are equal.

// strrchr()


// echo strrchr($strings , "a");
// returns the portion of string which starts at the last occurrence of substrin and goes until the end of string.


// strrev() : 
// echo strrev("Sudhir Gour");

// strlen() :
// echo strlen($strings);

// implode() : 

$array = [1,2,3,4,5];
$str_array = implode("~" , $array );

print_r(explode("~" , $str_array));


Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: