小编Cof*_*fee的帖子

Google Finance货币转换器

我正在使用谷歌货币转换器,它适用于所有货币,但没有显示ZAR - BTC转换 结果.

Google货币换算代码:

<?php
function convertCurrency($amount, $from, $to){
    $data = file_get_contents("https://finance.google.com/finance/converter?a=$amount&from=$from&to=$to");
    preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted);
    $converted = preg_replace("/[^0-9.]/", "", $converted[1]);
    return number_format(round($converted, 3),2);
}
echo convertCurrency("1000000", "ZAR", "BTC");
Run Code Online (Sandbox Code Playgroud)

预期的结果应该8.26来自谷歌,但它显示消息Could not convert

php google-finance

11
推荐指数
2
解决办法
2121
查看次数

获取响应中的消息 ID - SendGrid API v3

当我提交电子邮件时,我收到此回复,因为我正在处理API of SendGrid我需要获取我发送的每封邮件的统计信息..为此目的,我想要回复,Message-ID以便我可以将其保存在数据库中..我看过浏览文档但无法取得任何进展..提前致谢

PS:X-Message-Id 对此有帮助吗?如果是,那么如何..下面是我们可以检索邮件的文档的网址

https://sendgrid.api-docs.io/v3.0/email-activity/filter-all-messages

Array
(
    [0] => HTTP/1.1 202 Accepted
    [1] => Server: nginx
    [2] => Date: Tue, 27 Nov 2018 15:59:04 GMT
    [3] => Content-Type: text/plain; charset=utf-8
    [4] => Content-Length: 0
    [5] => Connection: keep-alive
    [6] => X-Message-Id: -ekBjiGXRNi7l5OdjBRcRA
    [7] => Access-Control-Allow-Origin: https://sendgrid.api-docs.io
    [8] => Access-Control-Allow-Methods: POST
    [9] => Access-Control-Allow-Headers: Authorization, Content-Type, On-behalf-of, x-sg-elas-acl
    [10] => Access-Control-Max-Age: 600
    [11] => X-No-CORS-Reason: https://sendgrid.com/docs/Classroom/Basics/API/cors.html
    [12] => 
    [13] => 
)
Run Code Online (Sandbox Code Playgroud)

php sendgrid

5
推荐指数
1
解决办法
3694
查看次数

字体大小未保存在DB-ckeditor中

我正在使用完整的ckeditor包,我在这里面临一个奇怪的问题,从2天.一切都很好,但font-size根本不工作.当我选择一行并更改它的字体大小时,它会在源模式下显示正确的代码:

<span style="font-size:9px">My selected line</span> 
Run Code Online (Sandbox Code Playgroud)

但是当我将这个结果保存在数据库中时,它会将此行转换为如下所示.

<span xss=removed> My selected line</span>
Run Code Online (Sandbox Code Playgroud)

我在保存数据之前使用CodeIgniter并且没有使用任何特殊功能.只是使用postCI的功能.

php codeigniter ckeditor

2
推荐指数
1
解决办法
201
查看次数

标签 统计

php ×3

ckeditor ×1

codeigniter ×1

google-finance ×1

sendgrid ×1