php to uppercase code example

Example 1: php string to uppwe

$lowercase = "this is lower case";
$uppercase = strtoupper($lowercase);

echo $uppercase;
// THIS IS LOWER CASE

Example 2: php uppercase

//string to all uppercase
$string = "String with Mixed use of Uppercase and Lowercase";
//php string to uppercase
$string = strtoupper($string);
// = "STRING WITH MIXED USE OF UPPERCASE AND LOWERCASE"

Example 3: strtoupper in php

<?php
/* There is a function in php wich convert all string to uppercase */

  echo strtoupper("Hello samy! how are u ?"); 

// output :   HELLO SAMY! HOW ARE U ?
?>

Example 4: php change sting to caps

$lowercase = "this is lower case";
$uppercase = strtoupper($lowercase);

echo $uppercase;

Example 5: php string mayusculas

<?php
$str = "Mary Had A Little Lamb and She LOVED It So";
$str = strtoupper($str);
echo $str; // muestra: MARY HAD A LITTLE LAMB AND SHE LOVED IT SO
?>

Example 6: upppercase php

$str = "upper";
//php string to uppercase
echo strtoupper($str); // => UPPER

Tags:

Php Example