Reputation: 13
I have a variable $foreground = 'FF03FF'
and I want to convert that variable to $foreground = 0xFF03FF
. How do i can convert it using php? Please help me.
Upvotes: 0
Views: 285
Reputation: 44444
You can use hexdec(..)
function
echo hexdec('FF03FF');
Output: 16712703 (in hex: 0xFF03FF)
Upvotes: 1