Strings in hindi

PHP String In Hindi – String Function In Hindi

PHP

PHP String In HindiString Functions In Hindi:- String Main Multiple Characters Hote Hain And PHP Main String Ke Liye Bahut Se String Functions Hain Jinka Istemal String Par Operation Karne Ke Liye Kiya Jata Hain |

Yadi Aapne  HTML Full Course  And CSS Full Course Nhi Read Kiya Hai To Aap Vah Bhi Read Kar Sakte Hai |

PHP String In Hindi

Contents

String Characters Ka Collection Hota Hain PHP Main String Ko “Double Quotes” Main Likha Jata Hain | Double Quotes(” “) Main Likhne Ke Sath Sath String Ko Single Quotes(‘ ‘) Main Bhi Likh Sakte Hain |

Example 1:

Aap Niche Diye Gaye Program Ko Dekh Sakte Hain Hamne Ek String $str Variable Liya Or Phir Use echo() Function Ki Help Se Print Kar Diya Hain |

<?php
$str = "Hello World";
echo $str;
?>

Output:

Hello World

Example 2:

<?php
$dk = "Hello sk : How Are You";
echo $dk;  
$sk = "Hello Dk : I am Fine";
echo $sk;  
?>

Output:

Hello sk : How Are You
Hello Dk : I am Fine

String Function In Hindi

PHP Main String Ke Kuch Functions Bhi Hote Hian Jo Koi Tarah Ke Task Ko Pura Karne Main Istemal Kiye Jate Hain |

PHP Main String Functions Ki Baat Ki Jaye To Ye Lagbhag 70+ Hain | Lekin Ham Kuch Important Function Ko Dekhne Wale Hain.

Important PHP String Functions In Hindi

String FunctionDescription
strlen()String Ki length Ko return Karta Hain|
strtolower()Uppercase string Ko Lowercase string Main convert Kar Deta Hain|
strtoupper()Lowercase string Ko Uppercase string Main convert Kar Deta Hain |
str_replace()String Main Se Kuch characters Ya substring Ko Kisi Dusre character Ya substring Se replace Kiya Jata Hain |
strcmp()Yaha Par 2 strings Ko compare Kiya Jata Hain |
trim()Starting Main Or Ending Ke substring Ya characters Ko trim Kiya Jata Hain |
ltrim()left-side Matlab Starting Ke substring Ya characters Ko trim Kiya Jata Hain|
rtrim()right-side Matlab Ending Ke substring Ya characters Ko trim Kiya Jata Hain |
ucwords()words Ke Har Pahle character Ko lowercase Se uppercase Main convert Kar Deta Hain |
lcfirst()string Main Se Pahla character uppercase Se lowercase Main convert Kar Deta Hain |
ucfirst()string Main Se Pahla character lowercase Se uppercase Main convert Kar Deta Hain |
strrev()string Ko reverse Kiya Jata Hain |
strip_tags()string Main Se HTML tags Ko remove Kar Deta Hain|
chop()String Ke Ending characters Ko remove Kar Deta Hain |
htmlentities()string Main Se HTML code Ko HTML entities Main convert Kar Deta Hain |

Len Function In PHP

PHP Main String Ki Length Ko Pata Karne Ke Liye strlen() Function Ka Istemal Kiya Jata Hain | Iska Example Niche Diya Gaya Hain.

Example:

<?php
$str = "Hello World!";
echo $str . "<br />";

$len = strlen($str);

echo "Length of String is ".$len;
?>

Output:

Hello World!
Length of String is 12

strtolower() Function In PHP

PHP Main strtolower() Function Uppercase string Ko Lowercase string Main convert Kar Deta Hain|

Example:

<?php
$str = "Hello World!";
echo $str . "<br />";

$lower = strtolower($str);

echo "LowerCase String : ".$lower;
?>

Output:

Hello World!
LowerCase String : hello world!

strtoupper() Function In PHP

PHP main strtoupper() Function Lowercase string Ko Uppercase string Main convert Kar Deta Hain |

Example:

<?php
$str = "Hello World!";
echo $str . "<br />";

$upper = strtoupper($str);

echo "UpperCase String : ".$upper;
?>

Output:

Hello World!
UpperCase String : HELLO WORLD!

str_replace() Function In PHP

PHP main str_replace() Function String Main Se Kuch characters Ya substring Ko Kisi Dusre character Ya substring Se replace Kiya Jata Hain |

Example:

<?php
$str = "Hello World!";
echo $str . "<br />";

$replace = str_replace("World", "Friends", $str);

echo "Replaced String : ".$replace;
?>

Output:

Hello World!
Replaced String : Hello Friends!

str_cmp() Function In PHP

PHP Main str_cmp() Function Yaha Par 2 strings Ko compare Kiya Jata Hain |

Example:

<?php

$compare1 = strcmp("Hello World", "Hello World");
echo $compare1 . "<br />";

$compare2 = strcmp("Hello World", "hello World");
echo $compare2 . "<br />";

$compare3 = strcmp("hello World", "Hello World");
echo $compare3 . "<br />";

?>

Output:

0
-1
1

trim() String Function In PHP

Starting Main Or Ending Ke substring Ya characters Ko trim Kiya Jata Hain |

<?php
$str = "Hello World!";
echo $str . "<br />";

$tr = trim($str, "Held!");
echo $tr;
?>

Output :

Hello World!
o Wor

ltrim() String Function

left-side Matlab Starting Ke substring Ya characters Ko trim Kiya Jata Hain|

<?php
$str = "Hello World!";
echo $str . "<br />";

$ltr = ltrim($str, "Held!");
echo $ltr;
?>

Output :

Hello World!
o World!

rtrim() String Function

right-side Matlab Ending Ke substring Ya characters Ko trim Kiya Jata Hain |

<?php
$str = "Hello World!";
echo $str . "<br />";

$rtr = rtrim($str, "Held!");
echo $rtr;
?>


Output :

Hello World!
Hello Wor

ucwords() String Function

words Ke Har Pahle character Ko lowercase Se uppercase Main convert Kar Deta Hain |

<?php
$str = "hello world!";
echo $str . "<br />";

$ucw = ucwords($str);
echo $ucw;
?>

Output :

hello world!
Hello World!

lcfirst() String Function

string Main Se Pahla character uppercase Se lowercase Main convert Kar Deta Hain |

<?php
$str = "Hello World!";
echo $str . "<br />";

$lcf = lcfirst($str);
echo $lcf;
?>

Output :

Hello World!
hello World!

ucfirst() String Function

string Main Se Pahla character lowercase Se uppercase Main convert Kar Deta Hain |

<?php
$str = "hello world!";
echo $str . "<br />";

$ucf = ucfirst($str);
echo $ucf;
?>

Output :

hello world!
Hello world!

strrev() String Function

string Ko reverse Kiya Jata Hain |

<?php
$str = "hello world!";
echo $str . "<br />";

$rev = strrev($str);
echo "Reverse String : ".$rev;
?>

Output :

hello world!
Reverse String : !dlrow olleh

strip_tags() String Function

string Main Se HTML tags Ko remove Kar Deta Hain|

<?php
$str = "<p><strong>Hello World!</strong></p>";
echo $str . "<br />";

$strt = strip_tags($str);
echo $strt;
?>


Output :

Hello World!


Hello World!

chop() String Function

String Ke Ending characters Ko remove Kar Deta Hain |

<?php
$str = "Hello World!";
echo $str . "<br />";

$ch = chop($str, "world!");
echo $ch;
?>

Output :

Hello World!
Hello W

htmlentities() String Function

string Main Se HTML code Ko HTML entities Main convert Kar Deta Hain |

<?php
$str = "<p><strong>Hello World!</strong></p>";
echo $str . "
";

$ent = htmlentities($str);
echo $ent;
?>

Output :

Hello World!


<p><strong>Hello World!</strong></p>

Friends Mujhe Umeed Hai Ki Aapko PHP String And String Function In Hindi Ke Bare Mai 100% Jankari Ho Gayi Hogi | Agar Aapko Learn Karne Main Dikkat Aa Rahi Hai To Aap Mere Se Contact Kar Sakte Hai |

Leave a Reply

Your email address will not be published. Required fields are marked *