PHP发短信 PEAR 包:Services_Sms

对于这种第三方库,PHP官方称之为PEAR,需要按照PEAR标准开发(标准URI)。

PEAR的优势:一键安装到php/lib/php目录,require即可使用,很方便。

由于项目要发短信,所以我开发了一个,现在整理开源出来。安装步骤如下:

pear channel-discover sinkcup.github.io/pear
pear install sinkcup/Services_Sms

0.0.1版支持下列短信服务商:

移通网络:http://www.etonenet.com/

短信宝:http://smsbao.com/

互亿无限:http://ihuyi.com/

使用步骤:

1、到短信服务商网站注册一个帐号,比如移通网络(http://www.etonenet.com/)。

2、demo(参考https://github.com/sinkcup/Services_Sms/blob/master/tests/Services/SmsTest.php):

<?php
require_once 'Services/Sms.php';
$conf = array(
'spid' => 'foo',
'sppassword' => 'bar',
'apiUriPrefix' => 'http://esms.etonenet.com/',
);
$c = new Services_Sms('etonenet', $conf);
$r = $c->send('13800138000', 'Hello!树先生 etonenet');
var_dump($r);
exit;
?>

源代码:https://github.com/sinkcup/Services_Sms

sinkcup PEAR 频道:http://sinkcup.github.io/pear/

最新文章

  1. c 高级函数的简单用法
  2. vmware下的centos上网配置
  3. iOS cannot find folder xcdatamodeld Xcode 7
  4. SQL Server 合并表 union 和union all
  5. 11 个最佳 jQuery 滚动条插件
  6. (贪心5.1.2)POJ 2287 Tian Ji -- The Horse Racing
  7. Eclipse没法自动补全代码解决
  8. SQL Server 2008 导出数据与导入数据任务介绍
  9. 查看当前发行版可以使用的shell
  10. STL容器存储的内容动态分配情况下的内存管理
  11. Postman使用教程学习笔记
  12. 一些JSON 教程
  13. SQL中哪些情况会引起全表扫描
  14. VB 对象未注册
  15. BZOJ_2058_[Usaco2010 Nov]Cow Photographs_逆序对
  16. 利用bootstrap-select.min.js实现bootstrap下拉列表的单选和多选
  17. 《Exception团队》第一次作业:团队亮相
  18. 快速排序的两种实现 -- 种轴partition : 比值partition(更精巧)
  19. div显示提示信息【转】
  20. 【xsy2274】 平均值 线段树

热门文章

  1. Java时间日期格式转换
  2. ASP.NET MVC TagBuilder使用
  3. Introduction of Open CASCADE Foundation Classes
  4. Spring学习总结(五)——Spring整合MyBatis(Maven+MySQL)一
  5. Activity onDestroy() 回调缓慢问题分析及完美解决方案
  6. SQL Server 2014里的针对基数估计的新设计(New Design for Cardinality Estimation)
  7. 解析导航栏的url--selnium,beautifulsoup实战
  8. Css定位总结
  9. Python语言特性之2:元类
  10. 通过原生JS实现为元素添加事件