Category Archives: php

list alphabet using php

Share I was looking for ways on how to list the alphabet without manually writing each one of them… I guess I found an answer here http://xqus.com/printing-alphabet-php. There were actually different methods being suggested. One that came from the author … Continue reading

Posted in php | Tagged , , | Leave a comment

mysql_data_seek to reset mysql recordset in php

ShareI’ve been into this situation where I need to reset the recordset for mysql and one way to do this is by using mysql_data_seek(). Sample below from mysql site: Description bool mysql_data_seek ( resource result, int row_number ) mysql_data_seek() moves … Continue reading

Posted in mysql, php | Tagged , | Leave a comment

ereg_replace used in paging

ShareAn example of ereg_replace for changing the value of page in an url ex: domain.com/index.php?page=3 ereg_replace(‘page=[0-9]+’, ‘page=’.$d, $uri);

Posted in anything under the moonlight, php | Tagged , | Leave a comment

php:levenshtein()

Share levenshtein (PHP 4 >= 4.0.1, PHP 5) levenshtein — Calculate Levenshtein distance between two strings Description int levenshtein ( string $str1 , string $str2 ) int levenshtein ( string $str1 , string $str2 , int $cost_ins , int $cost_rep … Continue reading

Posted in php | Tagged , | Leave a comment

leap year formula

Shareyear % 400 == 0 || (year % 100 != 0 && year % 4 == 0) This formula works perfectly for me. If you have any suggestions, comments or violet reactions just let me know.

Posted in php | Tagged | Leave a comment