Sunday, 14 March 2021

php: strtoupper: Get the string in uppercase form

Signature:

strtoupper ( string $string ) : string

 

Description

Returns a new string with all alphabetic characters converted to uppercase, it will not update the original string.

 

Example

$msg2 = strtoupper($msg1);

 

strtoupper_demo.php

#!/usr/bin/php

<?php

    $msg1 = "Hello KRISHNA, very good morning!!!!";
    $msg2 = strtoupper($msg1);

    echo "msg1 : $msg1\n";
    echo "msg2 : $msg2\n";

?>

Output

$./strtoupper_demo.php 

msg1 : Hello KRISHNA, very good morning!!!!
msg2 : HELLO KRISHNA, VERY GOOD MORNING!!!!




 

  

Previous                                                    Next                                                    Home

No comments:

Post a Comment