I try to convert an array of number to base 16 use intval
and I want learn how to pass second argument to interval, in default intval
use base 10.
array_map('intval', [1, 2, "12", "15" , "99"]);
Before I search in google and read php.net document but can't solve this problem.
You can define your own anonymous function:
array_map(function ($value) { return intval($value, 16); }, [1, 2, "12", "15", "99"]);
Demo: https://3v4l.org/PoFZN