Jump to content

Case differentiation?


maxudaskin

Recommended Posts

if you convert a string to upper case and if it doesn't change compared to the way it looked like before... it's already uppercase

if (strtoupper($the_string) == $the_string) { 
  echo '$the_string contains only upper case letters 
         and maybe other non-letter characters'; 
} 

 

Link to comment
https://forums.phpfreaks.com/topic/92374-case-differentiation/#findComment-473282
Share on other sites

I mean like, I wanted it to explode (except put every letter instead of every word or whatever seperated by a colon for example)... then check the letter and the case. After that, it will echo an image of a letter in a font only I have...

Link to comment
https://forums.phpfreaks.com/topic/92374-case-differentiation/#findComment-473310
Share on other sites

<?php
$a = range('A', 'Z');
$trans = array(' ' => ' ');
foreach ($a as $k)
{
    $trans[$k] = "<img src='$k.png' />";
}

$data = "A B C D";
echo strtr ($data, $trans);
?>

 

 

gives-->

<img src='A.png' /> <img src='B.png' /> <img src='C.png' /> <img src='D.png' />

Link to comment
https://forums.phpfreaks.com/topic/92374-case-differentiation/#findComment-474373
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.