Skip to content

Tag: php

date_parse_from_format to unix timestamp

I have a question regarding the date_parse_from_format() method: $parsed = date_parse_from_format(“Y d M H:i T”, ‘2012 28 Nov 21:00 CET’); Returns associative array with detailed info about given …

Database Driver MySQLi Error

I am running Moodle test environment on Window Vista having PHP 5.2.10 and MySQL 5.1.36-Community. When I upgrade from Moodle 1.9.9 to 2.0, I am getting the following error. I also tried to change the dbtype=’mysqli’ in config.ini and still see same error. I would really appreciate if you can prov…

permission denied – php unlink

I have two files: b.php and test.txt and the error is: Warning: unlink(test.txt) [function.unlink]: Permission denied why? b.php and test.txt is 777 and the same group/login if I set 777 on the parent directory I can execute unlink but i have to set 777 and back to 755? Answer You (as in the process that runs…

PHP – __call all the time

Say we have a class with several protected and/or public methods. I need to perform a check each time a method is called. I could do that check each time i call a method : or But i would like developers neither to have to think about it nor to write it. I’ve thought about using __call to do :