Solved

forcing to lowercase

Posted on 2013-12-08
13
223 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 31

Accepted Solution

by:
Marco Gasi earned 500 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 109

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:yodercm
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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:yodercm
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
array_values - reorder after unset? 5 21
PHP AJAX Wordpress 9 20
PHP curl issue VERBOSE output 18 39
Checkout Page Input Field not aligned 1 22
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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 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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

776 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