Archive for the ‘PHP’ Category

ตัด Tag ใน html ไฟล์ โดย PHP

สั้นๆง่ายๆ

<?php

strip_tags(’string str’);

?>

การอ่าน Tags Meta

ดึงจาก manual มาเลยหุหุ
<?php

$tags = get_meta_tags(’http://www.example.com/’);

echo $tags['author'];

echo $tags['keywords'];

echo $tags['description'];

?>

สูตรคำนวณ Start Rate

“มี 5 ดาว คือมีคะแนน 1-5 คะแนน”
$result = round((5*(ผลบวกคะแนนโหวต))/(5*(จำนวนคนโหวต));

ฟังก์ชั่นลบโฟลเดอร์ (Remove Folder)

Function

<?php
function removeFolder($dir){
if(!is_dir($dir))
return false;
for($s = DIRECTORY_SEPARATOR, $stack = array($dir), $emptyDirs = array($dir); $dir = array_pop($stack);){
if(!($handle = @dir($dir)))
continue;
while(false !== $item = $handle->read())
$item != ‘.’ && $item != ‘..’ && (is_dir($path = $handle->path . $s [...]

Powered by WordPress | Shop Free T-Mobile Phones Online | Thanks to Verizon Phones without Contract, MMORPG Games and Sell Car