Hi
Please help
I have this mysql table field with a RGB value like 120-10-200 and I
nead this php function to convert this value into html color
#??????
Thanks in advance 4 1952
On Thu, 21 Feb 2008 11:24:24 +0100, cj************@gmail.com
<cj************@gmail.comwrote:
Hi
Please help
I have this mysql table field with a RGB value like 120-10-200 and I
nead this php function to convert this value into html color
#??????
If you need in in css, it can perfectly handle rgb(123,123,123) values,
however, it's a simple matter of explode(), dechex() the items, and
implode() or concatenate.
--
Rik Wasmus cj************@gmail.com wrote:
I have this mysql table field with a RGB value like 120-10-200 and I
nead this php function to convert this value into html color #??????
<?php
$rgb = '120-10-200';
list ($r, $g, $b) = explode('-', $rgb);
$hex = sprintf('#%02x%02x%02x', $r, $g, $b);
?>
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 22 days, 17:55.]
Bottled Water http://tobyinkster.co.uk/blog/2008/02/18/bottled-water/
..oO(Toby A Inkster)
>cj************@gmail.com wrote:
>I have this mysql table field with a RGB value like 120-10-200 and I nead this php function to convert this value into html color #??????
<?php $rgb = '120-10-200'; list ($r, $g, $b) = explode('-', $rgb); $hex = sprintf('#%02x%02x%02x', $r, $g, $b); ?>
<?php
$rgb = '120-10-200';
$hex = vsprintf('#%02x%02x%02x', explode('-', $rgb));
?>
SCNR
Micha
On 21 Lut, 18:13, Michael Fesser <neti...@gmx.dewrote:
.oO(Toby A Inkster)
cjlopesmart...@gmail.com wrote:
I have this mysql table field with a RGB value like 120-10-200 and I
nead this php function to convert this value into html color #??????
<?php
$rgb = '120-10-200';
list ($r, $g, $b) = explode('-', $rgb);
$hex = sprintf('#%02x%02x%02x', $r, $g, $b);
?>
<?php
$rgb = '120-10-200';
$hex = vsprintf('#%02x%02x%02x', explode('-', $rgb));
?>
<?php $hex = vsprintf('#%02x%02x%02x', explode('-', '120-10-200')); ?>
:> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: VK |
last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked"
question.
This question led to a long discussion about the naming rules applying to
variables, objects, methods and properties...
|
by: Francois Keyeux |
last post by:
hello everyone:
i have a web site built using vbasic active server scripting running on
iis (it works on either iis 50 and 60, but is designed for iis 50)
i know how to create a plain text...
|
by: cirillo_curiosone |
last post by:
Hi,
i'm new to javascript. I started studing it on the web few weeks ago,
but still haven't been able to solve one big problem: HOT TO PASS VALUES
FROM A SCRIPT VARIABLE TO A CHILD HTML...
|
by: LRW |
last post by:
http://gto.ie-studios.net/index.php
When you view the above site in IE, if the 1st of the three product
images is tall enough to push the cell down a couple of pixels, IE
somehow doesn't show...
|
by: Boris Ammerlaan |
last post by:
This notice is posted about every week. I'll endeavor to use the same
subject line so that those of you who have seen it can kill-file the
subject; additionally, Supersedes: headers are used to...
|
by: Patient Guy |
last post by:
Taking the BODY element as an example, all of its style attributes
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01,
a fact noted in the DOM Level 2 HTML specification.
...
|
by: serge calderara |
last post by:
Dear all,
I am new in asp.net and prepare myself for exam
I still have dificulties to understand the difference between server control
and HTML control.
Okey things whcih are clear are the fact...
|
by: Guy Macon |
last post by:
cwdjrxyz wrote:
HTML 5 has solved the above probem. See the following web page:
HTML 5, one vocabulary, two serializations
http://www.w3.org/QA/2008/01/html5-is-html-and-xml.html
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |