473,395 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

php shortcuts

Hi,

Wanted to see if there was an even shorter way to do this using PHP
4.3. I have a GIF of a star. In my code, I have a variable, $rating,
which could be any number between 1 and 5. I want to display a star
for each rating point. Is there an even shorter way to output that
code other than the traditional for loop?

Thanks, - Dave

Aug 21 '06 #1
2 2180
la***********@zipmail.com schreef:
Wanted to see if there was an even shorter way to do this using PHP
4.3. I have a GIF of a star. In my code, I have a variable, $rating,
which could be any number between 1 and 5. I want to display a star
for each rating point. Is there an even shorter way to output that
code other than the traditional for loop?
http://www.php.net/str_repeat
JW
Aug 21 '06 #2
On 21 Aug 2006 05:37:27 -0700, "la***********@zipmail.com"
<la***********@zipmail.comwrote:
>Wanted to see if there was an even shorter way to do this using PHP
4.3. I have a GIF of a star. In my code, I have a variable, $rating,
which could be any number between 1 and 5. I want to display a star
for each rating point. Is there an even shorter way to output that
code other than the traditional for loop?
A for loop would be both short and clear, so I don't think there's much room
for improvement there.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Aug 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Luke Wright | last post by:
Hi, I have built a setup project to install an application I am developing. I would like to be able to prompt the user whether to install Shortcuts in the following locations: * Start Menu *...
0
by: Blake | last post by:
Hello, Does anyone know if there is any way to add a condition to your setup project so that the user can choose if they want a desktop shortcut or a program menu by selecting a checkbox. I...
0
by: DotNetJunkies User | last post by:
I am using the BrowseFolderDialog control in a Winform app to get a user selected path. Under Network Places, there are Folder Shortcuts to network resources. If a user selects one of these Folder...
4
by: blabore | last post by:
I have a MDI windows forms application that uses a toolbar on the parent form. I've also setup a context menu on this form to be used as the dropdown menu for one of the toolbar buttons. However,...
3
by: Marius Rus | last post by:
I have an application write in c# and i want to offer to the user to create himself shortcuts with icons for the main menu items. I will very much appreciate if will receive an helping hand. Thank...
0
by: GeorgeF | last post by:
How can I conditionally deploy shortcuts to my application? I have created a custom installer dialog box to give my users the option of creating desktop/start menu shortcuts, but the shortcuts do...
1
by: noleander | last post by:
Hello. Ive got a VC++ program. Inside the program Ive got some code that has a full file path: C:\aa\bb\cc\dd\file.txt One of the folders in that path (cc) is a shortcut pointing to some...
5
by: PAzevedo | last post by:
With ToolStripMenuItem objects i created a 'Tools' menu and from that menu droped an Item to which i assigned a ShortcutKey of 'Keys.Control | Keys.E', and the shortcut doesn't work. This...
331
by: Xah Lee | last post by:
http://xahlee.org/emacs/modernization.html ] The Modernization of Emacs ---------------------------------------- THE PROBLEM Emacs is a great editor. It is perhaps the most powerful and...
8
by: BD | last post by:
How can I duplicate the behavior of the operating system shortcut keys in my application? For example, my windows form has 5 controls (textboxes), the operating system will pickup which control...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.