Web user behavior: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 8: Line 8:
** PHP: 可用 [http://php.net/manual/en/function.trim.php rim] 函數處理。陣列元素值則搭配 [http://php.net/manual/en/function.array-map.php array_map] 函數處理。ex: {{kbd | key = <nowiki>$trimmed_array = array_map('trim' ,$array);</nowiki>}}<ref>[http://stackoverflow.com/questions/5762439/how-to-trim-white-spaces-of-array-values-in-php How to trim white spaces of array values in php - Stack Overflow]</ref>
** PHP: 可用 [http://php.net/manual/en/function.trim.php rim] 函數處理。陣列元素值則搭配 [http://php.net/manual/en/function.array-map.php array_map] 函數處理。ex: {{kbd | key = <nowiki>$trimmed_array = array_map('trim' ,$array);</nowiki>}}<ref>[http://stackoverflow.com/questions/5762439/how-to-trim-white-spaces-of-array-values-in-php How to trim white spaces of array values in php - Stack Overflow]</ref>
** jQuery: [http://api.jquery.com/jQuery.trim/ $.trim('string')]
** jQuery: [http://api.jquery.com/jQuery.trim/ $.trim('string')]
* 包含特殊符號 ex: 單引號 ', 雙引號 ", 反斜線 \, 大於小於符號 > < <== 對策: [http://www.php.net/manual/en/function.htmlentities.php PHP: htmlentities - Manual]
* 包含特殊符號 ex: 單引號 ', 雙引號 ", 反斜線 \, 大於小於符號 > < <== 對策: [http://www.php.net/manual/en/function.htmlentities.php PHP: htmlentities - Manual] {{kbd | key=<nowiki>echo htmlentities($str, ENT_QUOTES, "UTF-8");</nowiki>}}
* 超出預期的內容長度、超出預期的資料數量
* 超出預期的內容長度、超出預期的資料數量
* 資料數量從少量變成多量時
* 資料數量從少量變成多量時

Navigation menu