<?php 

function shortenText(&$source_text, $word_count) 
{ 
    $word_count++; 
    $long_enough = TRUE; 
    if ((trim($source_text) != "") && ($word_count > 0)) 
    { 
        $split_text = explode(" ", $source_text, $word_count); 
        if (sizeof($split_text) < $word_count) 
        { 
            $long_enough = FALSE; 
        } 
        else 
        { 
            array_pop($split_text); 
            $source_text = implode(" ", $split_text); 
        } 
    } 
    return $long_enough; 
} 


function sms($no,$msg)  {

/* Variables with the values to be sent. */
$owneremail="softdiddy@gmail.com";
$subacct="IBBU_TESTING";
$subacctpwd="IBBU_testing1";
$sendto=$no; /* destination number */
$sender="IBB UNIV"; /* sender id */
$message=$msg; /* message to be sent */
/* create the required URL */
$url = "http://www.smslive247.com/http/index.aspx?"
. "cmd=sendquickmsg"
. "&owneremail=" . UrlEncode($owneremail)
. "&subacct=" . UrlEncode($subacct)
. "&subacctpwd=" . UrlEncode($subacctpwd)
. "&message=" . UrlEncode($message)
. "&sender=" . UrlEncode($sender)
. "&sendto=" . UrlEncode($sendto)
. "&msgtype=0";
/* call the URL */
if ($f = @fopen($url, "r"))
{
    $answer = fgets($f, 255);
    if (substr($answer, 0, 1) == "+")
    {
    //echo "SMS to $sendto was successful.";
    }
    else
    {
    //echo "an error has occurred: [$answer].";
    }
    }
    else
    {
    //echo "Error: URL could not be opened.";
    }
 }





//how to csll it - uncomment d line below to use
//sms($pn,'Bosanigeria code:'.$code.' ');
?>