How to use PHP preg_replace on a formatted number based on search query while ignoring comma and decimal?
I want to highlight my search query on a formatted number. For example: $search_query = '1234'; // or $search_query = '7800'; $formatted_numeber = '12,345,678.00'; Currently my code is: preg_replace('/(' . $search_query . ')/i', "<span style='background: yellow'>$1</span>", $formatted_numeber); But this code…