私はPHPには新しいですが、すでに作成されているニュースレター通知を補うためにSMSプラットフォーム/通知を私のウェブサイトに作成しようとしていますが、私は、複数の変数を初期化して、 PHPコード。手順は以下の通りです:ステップ1でと場合は、上記の行ったよう
//i favour if...elseif over the switch method
//to declare the gateways variables
//step one. declaring gateways variables
$us_ca = array ('@txt.att.net', '@smscellular.com', '@more_gateways');
$nig = array ('@smsairtel.ng.com', '@more_gateways');
$gha = array ('@txt.mtn.com.gh', '@more_gateways');
..................................................
//note that the gateways are not correct but only cited as samples.
// i use more_gateways to represent others i couldn't write
// because of time and space
//step two. where the sms gets delivered.
if zip_code == '+1' {
email = '$telephone$us_ca', '$zip_code$telephone$us_ca'; //telephone
var for user's telephone, i create a second because some gateways
requires the country zip code.
} elseif zip_code == '+234'{
email = '$telephone$nig', '$zip_code$telephone$nig';
} elseif zip_code == '+233'{
email = '$telephone$gha', '$zip_code$telephone$gha';
}
........................................................
//note that i am targeting almost 90 countries.
は、今私が知りたいすべてが、それはしても大丈夫です場合は、複数のVAR私は第二段階のISN」を行った方法を初期化する配列varにゲートウェイを宣言されていますt悪い。
個々の電話番号が特定の国で送信されるユーザに固有の番号であるため、各SMSはアレイのすべてのゲートウェイに同時に送信されるため、SMSはユーザだけに配信できる最初にすべてのゲートウェイに着きますが。
ありがとうございます。
PHPから直接SMSを送信することはできません。あなたはtwilioまたはsmsghを試すことができます –
私はそれがPHPを介してSMSを送信することが可能であることを確認したオンライン投稿を見たと思う。あなた自身のために見るためにオンラインで徹底的なチェックをしてください。実際には、私は私の研究を通じてメソッドを持っていましたが、一度にゲートウェイ(またはゲートウェイの配列)に電子メールを送ることができると言われていますが、私はそのインスタンスにvarを追加できるかどうかを知りたいと思います。以下のように入力してください: if zip_code == '+1' { email = '$ zip_code。= $ telephone。= $ us_ca' } ご回答ありがとうございます。 – test
これをチェックしてください。 https://code.tutsplus.com/tutorials/how-to-send-text-messages-with-php--net-17693 –