Make the first character of each word in a string to uppercase
ucwords() function string-இல் உள்ள தனித்தனி word களின் முதல் character-ஐ uppercase-ஆக மாற்றுவதற்கு பயன்படுகிறது.
ucwords() Function in PHP
ucwords() function string-இல் உள்ள தனித்தனி word களின் முதல் character-ஐ uppercase-ஆக மாற்றுவதற்கு பயன்படுகிறது.
ucwords( string, separator)
Space
\t - tab
\n - newline
\r - carriage return
\f - form feed
\v - vertical tab
போன்ற separator argument-ஆக அனுப்பப்படுகிறது இது optional ஆகும்.
Example1
<?php
$input="Spread love everywhere you go";
echo ucwords($input);
?>
மேலே உள்ள Example1-ஐ கவனிக்கவும் $input என்ற variable-இல் "Spread love everywhere you go" என்ற string அனுப்பப்பட்டுள்ளது. இந்த string-ஐ ucwords என்ற function-இல் அனுப்பும் போது string-இல் உள்ள தனித்தனி word களின் முதல் character-ஐ மட்டும் uppercase-ஆக மாற்றுவதற்கு பயன்படுகிறது. எனவே output-ஆனது Spread Love Everywhere You Go. என மாறுகிறது.
Spread Love Everywhere You Go
Example2
<?php
$data="Belief creates the actual fact";
echo ucwords($data);
?>
மேலே உள்ள Example2-ஐ கவனிக்கவும் $data என்ற variable-இல் "Belief creates the actual fact" என்ற string அனுப்பப்பட்டுள்ளது. இந்த string-ஐ ucwords என்ற function-இல் அனுப்பும் போது string-இல் உள்ள தனித்தனி word களின் முதல் character-ஐ மட்டும் uppercase-ஆக மாற்றுவதற்கு பயன்படுகிறது. எனவே output-ஆனது Belief Creates The Actual Fact. என மாறுகிறது.
Belief Creates The Actual Fact