Skip to content

Instantly share code, notes, and snippets.

@IsaevDimka
Last active July 2, 2018 06:58
Show Gist options
  • Select an option

  • Save IsaevDimka/9e2f17f9e48bdee4ce8810300e805371 to your computer and use it in GitHub Desktop.

Select an option

Save IsaevDimka/9e2f17f9e48bdee4ce8810300e805371 to your computer and use it in GitHub Desktop.
function parser_sms($text){
preg_match('/([0-9]{4,})/', $text, $result_pass);
preg_match('/([0-9]{12,})/', $text, $yandex_wallet);
preg_match('/([0-9,]{2,})р./', $text, $money);
return array(
'password' => $result_pass[1],
'yandex_wallet' => $yandex_wallet[1],
'money' => $money[1]
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment