Format output to lowercase

为君一笑 提交于 2019-12-04 07:10:57

问题


I need to change the output of <?php echo $EM_Category->name; ?> to lowercase only.

Output now is Entertainment. How would I get it to entertainment

Full section of code is:

<?php foreach(EM_Categories::get(array('orderby'=>'category_name')) as $EM_Category): ?>
<a href="<?php echo THEME_URL; ?>/events/category/<?php echo $EM_Category->name; ?>" class="browse-cat">
   <span><?php echo $EM_Category->name; ?></span><img src="<?php echo THEME_URL; ?>/images/box_arrow.png" alt="arrow" height="15" width="15">
</a>
<?php endforeach; ?>

回答1:


<?php echo strtolower($EM_Category->name); ?>

http://us.php.net/strtolower




回答2:


That would be the strtolower function.

<?php echo strtolower($EM_Category->name); ?>



回答3:


<?php echo strtolower($EM_Category->name); ?>



回答4:


In PHP you use:

echo strtolower($EM_Category->name);


来源:https://stackoverflow.com/questions/7941610/format-output-to-lowercase

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!