Solved

forcing to lowercase

Posted on 2013-12-08
13
225 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 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 110

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
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!

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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 dynamically set the form action using jQuery.

749 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