Monthly Archives: September, 2017

Cài đặt nodejs lên aws

http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html

Xóa comment trong html, đếm số thẻ tag trong html

// Remove unwanted HTML comments
function remove_html_comments($content = '') {
	return preg_replace('/<!--(.|\s)*?-->/', '', $content);
}
 //get count tag in html
 function getCountTagInHtml($content,$tag) {
    $c = 0;
    if(trim($content)!=""){
       try {
           $dom = new DOMDocument;
           $dom->loadHTML($content);
           $c = $dom->getElementsByTagName($tag)->length;
       } catch (Exception $exc) {
       }
     }
    return $c;
 }

Copyright © 2017. Powered by WordPress & Romangie Theme.