Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

forcing to lowercase

Posted on 2013-12-08
13
Medium Priority
?
229 Views
Last Modified: 2013-12-15
How can i force this output on my array into all lowercase?
	<b><?php echo CHtml::encode($data->getAttributeLabel('url')); ?>:</b>
	<?php echo CHtml::encode($data->url); ?>

Open in new window

0
Comment
Question by:rivkamak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
13 Comments
 
LVL 31

Accepted Solution

by:
Marco Gasi earned 2000 total points
ID: 39704667
Where is the array? I see only an object. Perhaps this could work, epending on the exact job of the function CHtml::encode()

	<b><?php echo strtolower(CHtml::encode($data->getAttributeLabel('url'))); ?>:</b>
	<?php echo strtolower(CHtml::encode($data->url)); ?>

Open in new window


But it would be better to see the class code...
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39704901
If you're new to PHP this article will help you get a foundation.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html

Please see: http://www.laprbass.com/RAY_temp_rivkamak.php

<?php // RAY_temp_rivkamak.php
ini_set('display_errors', TRUE);
error_reporting(E_ALL);
echo '<pre>';

// TEST DATA
$str = "This CapiTalization DoESN't MAKE ANY seNSe.";
echo PHP_EOL . $str;

// SHOW A COUPLE OF TRANSFORMATIONS
$new = strtolower($str);
echo PHP_EOL . $new;

$new = ucfirst($new);
$new = str_replace("doesn't make any", "makes good", $new);
echo PHP_EOL . $new;

Open in new window

0
 
LVL 27

Expert Comment

by:Cornelia Yoder
ID: 39716628
WHAT???????????   I gave him the function name that he needed, and a link to the documentation on how to use it!!!!!!!!!

It was NOT a blind link, it was a link to the php manual for that function.

He accepted MY answer, and I am the one who offered to share the points.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 31

Expert Comment

by:Marco Gasi
ID: 39716760
I totally agree with yodercm. I think the new policy of EE to censor comments which are unoffensive and politically correct is wrong in general. Censoring links to external sites, even if Q&A sites, makes EE to become a closed world and this goes against any acceptable concept of knowledge, especially scientific knowledge. It's a mystical perspective wich makes EE more similar to a beliefs than to a scientific community.

In this case, I think it has been applied erronoeusly: so, IMHO, a double error.
0
 
LVL 27

Expert Comment

by:Cornelia Yoder
ID: 39719580
The really sad part of this is that I DID show it.  I gave exactly what the asker needed, and he accepted my post over that of marquisG's posted first, clearly proving that mine was more useful.

I also gave a link to the documentation that was self-explanatory.  Would it have made a difference if I had posted

"You need to use the strtolower() function, and the documentation is here:  ... yadayada link"

Does a concise answer rate lower than a wordy one, when the same information is totally obvious?   The asker accepted the concise answer.
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 39719596
@Netminder: following your link I get

503 Service Unavailable
No server is available to handle this request.

?
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 39719616
Thanks, you're really kind.
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 39719646
:-) ... but I know people who are kind never with nobody...
Cheers
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question