Parsyu data, and the output is such lines

array:2 [▼ 0 => """ Цена:\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t312 000 тнг """ 1 => """ Цена:\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t7 847 тнг """ ] 

How to clear these lines and get only numbers?

    1 answer 1

    You can use regular degeneration:

     preg_replace("/\s+/", " ", $string); 

    This will remove all double spaces, tabs and new lines.

     preg_replace("/\D/", "", $string); 

    This will return only numbers.