0

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.

1 Answers1

1

You can use hexdec(..) function

echo hexdec('FF03FF');

Output: 16712703 (in hex: 0xFF03FF)

UltraInstinct
  • 43,308
  • 12
  • 81
  • 104