You can download example here. (give class «image2″ for images you want with shadow)
Howto: make :before {content: «»; } in IE
It’s not simple. IE not support :before method. You can add a background with image of content:
ul li {
list-style: none;
background: none !important;
background: url(images/list.gif) 0 0 no-repeat;
padding-left: 15px;
}
Howto: print site creation and now year
© 2007<? if (date("Y") !== "2007") { print "-".date("Y"); }?>
Howto: finereading password generator
<?
$cons = array("q","w","r","t","p","s","d","f","g","h",
"j","k","l","z","x","c","v","b","n","m");
$tran = array("e","y","u","i","o","a");
$sylls = 3; // count of syllables $pass = "";
for ($c=0;$c<$sylls;$c++) {
$con = $cons[rand(0,count($cons)-1)];
$tra = $tran[rand(0,count($tran)-1)];
$pass .= $con.$tra; }
print $pass;
?>
Howto: delete one row from text file
It’s very simple:
<?
if ($id != "")
{
$id--;
$file=file("file.txt");
$fp=fopen("file.txt","w");
for($i=0;$i<sizeof($file);$i++)
{
if($i==$id)
{
unset($file[$i]);
}
}
fputs($fp,implode("",$file));
fclose($fp);
}
?>
PHP Tip: Use the links in the processing of large volumes of data to save memory server.
Work with references is more acceptable when processing large amounts of information, albeit slightly slower than working with a copy, but uses less memory. Therefore, you should independently determine what resources stocks to make better use of server-CPU or memory.
PHP Tip: without the need don’t use RegExp
In PHP than regular expressions, there is a large number of text-processing functions, which in some cases can replace them, while saving resources server.
Incorrect: <? $new = ereg_replace(«-»,»_»,$str); ?>
Correct: <? $new = str_replace(«-»,»_»,$str); ?>
Incorrect: <? preg_match(«/(\..*?)$/»,$str,$reg); ?>
Correct: <? substr($str,strrpos($str,)); ?>
Text splitter
Today I wrote function for split a long text to pages.
You can download script with example here.
Hi all!
In this blog I’ll try to open some features in web-programming. I make site on WP, and create plugins for it. You can see my plugins on my development blog.
Howto: most commented posts & last comments in WordPress
{ Ноябрь 21, 2007 @ 10:12 дп } · { DiP }
{ Tags: comments, howto, php, wordpress } · { Добавить комментарий }
It’s so easy. You can view example here.