Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- @description A function to receive SMS from FreeSMS4Us.com
- @author Jefrey S. Santos <jesobreira[at]yahoo[dot]com[dot]br>
- THIS FILE IS PRIVATE. NO RELEASE ALLOWED. ---------------\
- ILLEGAL PUBLISHERS WILL BE RESPONSIBLE, ACCORDING TO |
- FOLLOWING COPYRIGHT INFRINGEMENT LAWS: |
- - 18 U. S. C. § 2, 2319 |
- - 17 U. S. C. § 506 |
- - 18 U. S. C. §. 371 |
- |
- (kidding, my love kkkkk ;) <-----------------------------/
- Example output:
- Irene (083830637802)
- Array
- (
- [0] => U ALREADY DIE? WHY U DONT REPLY MY TEXT MESSAGE!!!!!!
- [1] => JEFREY!!!!!!!!
- [2] => Heeyyy!
- [3] => Yeah
- [4] => No
- [5] => Idk bored
- [6] => Not funny
- [7] => Not funny
- [8] => Good night. Im bored, make something funny or make me suprised
- [9] => No!-_- gonna watch my favorite movie
- [10] => Why crazy?
- [11] => Im at home! Now i wanna take a bath
- [12] => No after this ill have lesson
- [13] => I already go to bsktbll club, n now im at home
- [14] => I hav arrvd at home
- [15] => Ok later if i can open my fb ill reply ur message.. Now i wanna go to basketball club
- [16] => Kkkkk how r u?
- [17] => Okayyy
- [18] => Yeah thank you :)
- [19] => Different number phone again?
- [20] => Miss u too
- [21] => Thankyou :D Have a nice dream
- [22] => Jefrey :D
- )
- */
- function getsms($number) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "http://freesms4us.com/reply.php");
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "nomer=$number");
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
- curl_setopt($ch, CURLOPT_TIMEOUT, 60);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $store = curl_exec($ch);
- $store = strip_tags($store);
- $store = explode("\n", $store);
- $store = array_map("trim", $store);
- $msgs = array();
- foreach($store as $line) {
- $pattern = "/^SMS no:\-[0-9]*\. [ ]{4}(.*) \)(.*)$/";
- if(preg_match($pattern, $line)) {
- $res = array();
- preg_match_all($pattern, $line, $res);
- if(count($res)) {
- $msgs[] = $res[2][0];
- }
- }
- }
- return sizeof($msgs) ? $msgs : false;
- }
- $nbr = array();
- $nbr['Irene'] = "083830637802";
- foreach($nbr as $name=>$num) {
- echo "\n$name ($num)\n";
- print_r(getsms($num));
- }
Add Comment
Please, Sign In to add comment