Jump to content

PHP Алгоритм корректности (валидности) кошелька PAYEER


KirKMS

Recommended Posts

Всем привет.

Может кому пригодиться функция проверки кошелька Payeer 

Например для выплат на кошелек.

function validatePayeer($purse){
        if (substr($purse, 0, 1) != "P") {
            return false;
        }
        if (!preg_match("/^[0-9]{7,11}$/", substr($purse, 1))) {
            return false;
        }
        return $purse;
    }
	if (!validatePayeer('P000000000')) {
    echo 'ошибка в номере Payeer';
}

 

  • Upvote 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...