但ie8似乎不支援,往路上找到個解決方法,成功解了這問題
[……]
[……]
天呀!!我今天才發現,強大的Googe大神,居然也有提供字型的服務,
這對於做網站設計真的是增加非常多的彈性,Google倒了該怎麼辦呀呀呀呀!!!!
Google Fronts
https://www.google.com/fonts
可以一次加入多種字型
還可以選擇多種字體樣式
並且右方能告訴你載入的速度
還教你如何使用你選擇的字型,可說是非常大心,
提供三種使用的方式:
1.HTML LINK 標籤載入。
2.CSS @import 方式載入。
3.Javascript 方式載入。
[……]
以前一直有個觀念是網頁只能用系統字型,
}
相關網址
https://vector.cool/css-load-font/
http://www.w3schools.com/cssref/css3_pr_font-face_rule.asp
不過,
我想中文字型如果非必要,還是別了吧,因為中文字型檔通常很大,
雖然沒實際測過,但我相信一定會影響載入速度
[……]
http://sub.domain.com/page.htm
. use the following in page code to achive those results:window.location.host
: you’ll get sub.domain.com:8080
or sub.domain.com:80
window.location.hostname
: you’ll get sub.domain.com
window.location.protocol
: you’ll get http:
window.location.port
: you’ll get 8080
or 80
window.location.origin
: you’ll get http://sub.domain.com
*window.location.origin
is not clear. I’ve checked it in chrome and it returned http://sub.domain.com:port
.[……]
[……]
echo preg_replace(‘/[rt]/’, ‘ ‘, $xml);
[……]
引用網址
https://gist.github.com/tfnet/2037443
PHP 使用 simplexml_load_string() 解析 XML 資料,
要一直 $node->children() 一個節點一個節點的取,這樣用實在很麻煩,
如果能一次把 XML 結構資料轉成 Array 在讀裡面的資料就非常好用了,
網路查了一下看到神人分享的function,完全用原本的XML結構打造成Array,非常好用,
該網址提供的程式碼較適用於Class中,我做了一點小小的修改,
原版本請連文章上方引用網址,修改後版本請於文章下方 Download
<?php
/**
* Converts a simpleXML element into an array. Preserves attributes.<br/>
* You can choose to get your elements either flattened, or stored in a custom
* index that you define.<br/>
* For example, for a given element
* <code>
* <field name=”someName” type=”someType”/>
* </code>
* <br>
* if you choose to flatten attributes, you would get:
* <code>
* $array[‘field’][‘name’] = ‘someName’;
* $array[‘field’][‘type’] = ‘someType’;
* </code>
* If you choose not to flatten, you get:
* <code>
* $array[‘field’][‘@attributes’][‘name’] = ‘someName’;
* </code>
* <br>__________________________________________________________<br>
* Repeating fields are stored in indexed arrays. so for a markup such as:
* <code>
* <parent>
* <child>a</child>
* <child>b</child>
* <child>c</child>
* …
* </code>
* you array would be:
* <code>
* $array[‘parent’][‘child’][0] = ‘a’;
* $array[‘parent’][‘child’][1] = ‘b’;
* …And so on.
* </code>
* @param simpleXMLElement $xml the XML to convert
* @param boolean|string $attributesKey if you pass TRUE, all values will be
* stored under an ‘@attributes’ index.
* Note that you can also pass a string
* to change the default index.<br/>
* defaults to null.
* @param boolean|string $childrenKey if you pass TRUE, all values will be
* stored under an ‘@children’ index.
* Note that you can also pass a string
* to change the default index.<br/>
* defaults to null.
* @param boolean|string $valueKey if you pass TRUE, all values will be
* stored under an ‘@values’ index. Note
* that you can also pass a string to
* change the default index.<br/>
* defaults to null.
*
* @return array the resulting array.
*/
function simpleXMLToArray($xml,$attributesKey=NULL,$childrenKey=NULL,$valueKey=NULL)
{
if($childrenKey && !is_string($childrenKey)){
$childrenKey = ‘@children’;
}
if($attributesKey && !is_string($attributesKey)){
$attributesKey = ‘@attributes’;
}
if($valueKey && !is_string($valueKey)){
$valueKey = ‘@values’;
}
$return = array();
$name = $xml->getName();
$_value = trim((string)$xml);
if(!strlen($_value)){
$_value = null;
};
if($_value!==null){
if($valueKey){
$return[$valueKey] = $_value;
}
else{$return = $_value;
}
}
$children = array();
$first = true;
foreach($xml->children() as $elementName =&g[……]
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, “http://yourdomain.com.tw” );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type: text/plain’));
curl_setopt($ch, CURLOPT_POSTFIELDS, “POST RAW 資料” );
$result=curl_exec ($ch);
引用資料
[……]