Solved

forcing to lowercase

Posted on 2013-12-08
13
220 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
  • 5
  • 2
13 Comments
 
LVL 30

Accepted Solution

by:
Marco Gasi earned 500 total points
Comment Utility
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 108

Expert Comment

by:Ray Paseur
Comment Utility
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:yodercm
Comment Utility
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
 
LVL 30

Expert Comment

by:Marco Gasi
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 27

Expert Comment

by:yodercm
Comment Utility
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 30

Expert Comment

by:Marco Gasi
Comment Utility
@Netminder: following your link I get

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

?
0
 
LVL 30

Expert Comment

by:Marco Gasi
Comment Utility
Thanks, you're really kind.
0
 
LVL 30

Expert Comment

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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now