Send an SMS message with yii2

I started with yii2. I want to send an SMS message with yii2. Can anyone help?

I wrote this code in php and it works perfectly

<form id="form1" name="form1" method="post" action="">

<input name="to_number" type="text" id="to_number" />

<input type="submit" name="submit" id="submit" value="Submit" />

</form>

<?php

if ( isset($_POST[‘submit’]) ){

		&#036;rand=rand(1000,9999);


		&#036;to_number = array(&#036;_POST[&quot;to_number&quot;]);


		&#036;message = array(&#036;rand); 


         


		&#036;client = new SoapClient(&quot;parsasms.com/webservice/v2.asmx?WSDL&quot;);


		&#036;params = array(


			'username' 	=&gt; 'demo',


			'password' 	=&gt; 'demo',


			'senderNumbers' =&gt; array(&quot;30005006002651&quot;),


			'recipientNumbers'=&gt; &#036;to_number,


			'messageBodies' =&gt; &#036;message


		);


		&#036;results = &#036;client-&gt;SendSMS( &#036;params );


		echo  &#036;rand;		

}

?>

PLZ anybody can help…

Welcome to Yii and the forum Hassan!

Please post your question to the forum for Yii2 (you posted this to the Yii1.1 forum).

Also, please tell us what error message or problem you get with the code you posted.

Thank you dear friend