forcing to lowercase

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

Who is Participating?
Marco GasiConnect With a Mentor FreelancerCommented:
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...
Ray PaseurCommented:
If you're new to PHP this article will help you get a foundation.

Please see:

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

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

$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

Cornelia YoderArtistCommented:
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.
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Marco GasiFreelancerCommented:
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.
Cornelia YoderArtistCommented:
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.
Marco GasiFreelancerCommented:
@Netminder: following your link I get

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

Marco GasiFreelancerCommented:
Thanks, you're really kind.
Marco GasiFreelancerCommented:
:-) ... but I know people who are kind never with nobody...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.