Aug
11
2008
I am saving this for my reference , A post with all commonly used regex, first one to go is finding <img> tag through php using regex.
$pattern = ‘/<img[^>]+src[\\s=\'"]‘;
$pattern .= ‘+([^"\'>\\s]+)/is’;
if(preg_match($pattern,$subject,$match))
{
echo $match[0];
}
Tags: php, regex
Aug
02
2008
Usually we all get very greedy while making our url structure using .htaccess
For example, This will not work as you think
RewriteRule ^(.*)/$ category/categories.php?cat=$1 [L,QSA]
RewriteRule ^(.*)/(.*)/$ category/categories.php?cat=$1&name=$2 [L,QSA]
This will not work as after first rewrite will write , the current url structure will change to www.mydomain.com/<something>, Which will result to the last rewrite rule to be [...]
Tags: apache, php
Jun
05
2008
I have been following cakephp framework for any new development that i do, But since now and then you come along some fixing work for old scripts.
I hate really fiddling with javascript for cross-browser issues everytime i use them, After starting through frameworks finally i got common sense of not re-inventing wheel again and again [...]
Tags: framework, javascript, programming
May
30
2008
Just needed to install and make ready smarty for a small project, Was thiking of again going to official howto when i stumbled to a very nice “For dummies” article for putting smarty out of box http://tinyurl.com/5py5o8
Nice work dude.
Tags: php, smarty