How to remove the special characters in title?

$hotel=" How to study; PHP? ";
$foldername = stripslashes ($hotel);
//This erase white-spaces on the beginning and the end in each line of a string:
$foldername = preg_replace('~^(\s*)(.*?)(\s*)$~m', "\\2", $foldername);
//erases all NON-alfanumerics
$foldername = ereg_replace("[^[:alnum:] ]","",$foldername); Read the rest of this entry »

how to add php code in phpld, find current url?

It is very simple,just like this:

{php}
echo “PHP
“;
echo “I love PHP
“;
echo “included in .tpl
“;
{/php}

Find the Current URL with PHP Read the rest of this entry »

Show random ads at phpld

If you’re looking for a simple static solution (an not an entire ad manager) use this
add in your init.php after the $tpl = get_tpl(… line Read the rest of this entry »

How to show all files under a document and rename the file names?

$dirname=”E:/zhanzhongjie/chengbiao-com/chengbiao-com”;
$dir_handle=opendir($dirname);
while($file=readdir($dir_handle))

{
echo $file.”
“;
rename(”E:/zhanzhongjie/chengbiao-com/chengbiao-com/”. $file, “E:/zhanzhongjie/chengbiao-com/chengbiao-new/insurance-”.$file);
}

closedir($dir_handle) Read the rest of this entry »

Remove hyperlinks ( A tag) from HTML

Sometimes we want to remove hyperlinks with anker text, sometimes only keep anker text, how to use php to achive this?

First, only remove hyperlink, and keep anker text part, the code is:

$text = ‘Test paragraph.’; Read the rest of this entry »