通过 IP 检测位置
如果找到位置,则返回“城市,州”,否则返回顶部设置的默认值。
function detect_city($ip) {
$default = 'UNKNOWN';
if (!is_string($ip) || strlen($ip) < 1 || $ip == '127.0.0.1' || $ip == 'localhost')
$ip = '8.8.8.8';
$curlopt_useragent = 'Mozilla/5.0 (Windows; U;
…发送短信
您需要一个 TextMagic 帐户,并在注册后下载他们的 PHP 助手。
// Include the TextMagic PHP lib
require('textmagic-sms-api-php/TextMagicAPI.php');
// Set the username and password information
$username = 'myusername';
$password = 'mypassword';
// Create a
…删除内联样式
此函数还保留隐藏的内容。
function remove_style(all) {
var i = all.length;
var j, is_hidden;
// Presentational attributes.
var attr = [
'align',
'background',
'bgcolor',
'border',
'cellpadding',
'cellspacing',
'color',
'face',
'height',
'hspace',
'marginheight',
'marginwidth',
'noshade',
'nowrap',
'valign',
'vspace',
'width',
…Shop Talk 第 1 集
Shop Talk 的首播集,我和 Dave 邀请了 Jonathan Snook,我们回答了一堆听众的问题。抱歉有鼻音和其他瑕疵,我们会慢慢改进的。由 LessAccounting…
HTML5 <audio> 的问题
- 微软 为 Pixel Lab 提供资金,制作了 Cut The Rope 的 HTML5 版本,最初由 ZeptoLab 制作。
- 极客们指责它使用了 Flash。
- Robby Ingebretsen 撰写了一篇非常有趣的文章,解释了原因。
常用 Unicode 图标
a[href^="mailto:"]:before { content: "\2709"; }
.phone:before { content: "\2706"; }
.important:before { content: "\27BD"; }
blockquote:before { content: "\275D"; }
blockquote:after { content: "\275E"; }
.alert:before { content: "\26A0"; }
<p>
<a href="mailto:[email protected]">
[email protected]
</a>
</p>
<p class="phone">
555-555-5555
</p>
…