I'm looking for a more efficient code solution (in PHP) for the code bellow. This code is called a lot of times and has been pointed by webgrind as the source of bad performance. (Comparing with all the other components of my code).
$xName = "com.company.product";
$xApp = explode(".", $xName);
$xApp = end($xApp);
$xApp = strtoupper($xApp);
Example Input: com.company.product
Example Output: PRODUCT
How should I re-code this to have the same output and be faster? Thank you.
self cost.explode()was definitely the source of the problem. This is fixed now using Jasper solution but thanks anyway ;)