Archive for the ‘php’ Category

Snoopy library Bug

if there is any https link in a http page then when getting the links with fetchlink functioin snoopy.class.php return result like

But it should not prefix the domain name.

the solution is to replace the line in _expandlinks function with

Replace: “|^(?!http://)(?!mailto:)|i”,
Replace With:”|^(?!http://)(?!https://)(?!mailto:)|i”,

But the problem does not exists.

Thank you.

Categories: php

Running php code from command prompt

The trix is using -r option with php .

Say I like to see output of phpinfo() function without writing phpinfo() in any file.

so, The magic is

php -r ‘echo phpinfo();’

php -r ‘$x=10; echo $x + 5;’

Categories: php

difference between $this & self in php

$this is used to access members of object ( like non static method or variable) where as self used for member of class ( like static method or variable).

Categories: php Tags: ,