Php string functions in Hindi

php strings function in hindi

Php string function in Hindi

php में string के लिए कई सारे function है वह string function core php का एक भाग है| string के सभी functions का इस्तेमाल के लिए किसी प्रकार की installation की जरुरत नहीं है||

ये सभी functions php के library file में पहले से लिखे हुवे होते है| हमें सिर्फ उस function को call करना होता है| और related function के अनुसार हम अपना task perform करा सकते है|


strlen() function in hindi

string की length find करने के लिए| strlen() function का इस्तेमाल करके हम string की length find कर सकते है||

Example:

<?php

 $str = "Hello this is string";
 echo "String length is ".strlen($str);

?>

output

String length is 20

strtolower() function in hindi

php में किसी बी string को uppercase to lowercase में convert करने के लिए strtolower() function का इस्तेमाल होता है||

Example:

<?php

$strlwr = "HELLO THIS IS STRING";

echo $strlwr."<br>";

echo "This is lower case string :" .strtolower($strlwr);

?>

output

HELLO THIS IS STRING
This is lower case string : hello this is string

strtoupper() function in hindi

php में किसी बी string को lowercase to uppercase में convert करने के लिए strtoupper() function का इस्तेमाल होता है||

Example:

<?php

$strupr = "hello this is string";

echo $strupr."<br>";

echo "This is upper case string :" .strtoupper($strupr);

?>

output

hello this is string
This is upper case string : HELLO THIS IS STRING

str_word_count() function in hindi

str_word_count() function string में जितने बी number of word है ये सभी word का total number बताता है||

Example:

<?php

 $str = "Hello this is string";

 echo "Total Number of word is : " .str_word_count($str);
 
?>

output

Total Number of word is : 4

strpos() function in hindi

Main string मेसे substring को find करने के लिए strpos() function का इस्तेमाल होता है || strpos() function substring की position return करता है|

Example:

<?php

 $str = "Hello this is string";

 echo "String Position Number is :". strpos($str, 'this');
 
?>  

output

String Position Number is : 6

strrev() function in hindi

string को reverse में set करने के लिए strrev() function का इस्तेमाल होता है||

Example:

<?php

 $str = "Hello this is string";

 echo "This is reverce string  : " . strrev($str);
 
?> 

output

This is reverce string : gnirts si siht olleH

str_replace() function in hindi

string में text को replace करने के लिए str_replace() function का इस्तेमाल किया जाता है ||

Example:

<?php

 $str = "Hello this is testing";

 $replc = str_replace('testing','online',$str);

 echo $replc;  

?>

output

Hello this is online

str_repeat() function in hindi

str_repeat() function का इस्तेमाल करके कई बार string को repeat करा सकते है||

Example:

<?php

 $str = "Hello this is testing";

 echo str_repeat('hello',5);

?>

output

hellohellohellohello

Leave a Comment

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