Now Hiring: Are you a driven and motivated 1st Line IT Support Engineer?

Send USSD request – PHP Integration

Send USSD request – PHP Integration

  • </pre>
    <pre class="prettyprint prettyprinted"><span class="kwd">try</span> <span class="pun">{</span>
        <span class="com">// Send a USSD request using default SIM of Device ID 1.</span><span class="pln">
        $ussdRequest </span><span class="pun">=</span><span class="pln"> sendUssdRequest</span><span class="pun">(</span><span class="str">"*150#"</span><span class="pun">,</span> <span class="lit">1</span><span class="pun">);</span><span class="pln">
        print_r</span><span class="pun">(</span><span class="pln">$ussdRequest</span><span class="pun">);</span>
        
        <span class="com">// Send a USSD request using SIM in slot 1 of Device ID 1.</span><span class="pln">
        $ussdRequest </span><span class="pun">=</span><span class="pln"> sendUssdRequest</span><span class="pun">(</span><span class="str">"*150#"</span><span class="pun">,</span> <span class="lit">1</span><span class="pun">,</span> <span class="lit">0</span><span class="pun">);</span><span class="pln">
        print_r</span><span class="pun">(</span><span class="pln">$ussdRequest</span><span class="pun">);</span>
        
        <span class="com">// Send a USSD request using SIM in slot 2 of Device ID 1.</span><span class="pln">
        $ussdRequest </span><span class="pun">=</span><span class="pln"> sendUssdRequest</span><span class="pun">(</span><span class="str">"*150#"</span><span class="pun">,</span> <span class="lit">1</span><span class="pun">,</span> <span class="lit">1</span><span class="pun">);</span><span class="pln">
        print_r</span><span class="pun">(</span><span class="pln">$ussdRequest</span><span class="pun">);</span>
    <span class="pun">}</span> <span class="kwd">catch</span> <span class="pun">(</span><span class="typ">Exception</span><span class="pln"> $e</span><span class="pun">)</span> <span class="pun">{</span><span class="pln">
        echo $e</span><span class="pun">-></span><span class="pln">getMessage</span><span class="pun">();</span>
    <span class="pun">}</span></pre>
    <pre>

Leave your thought here

Your email address will not be published.