Archive

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

http://host.name/https://NewHTTPHOST

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.

Advertisements
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();’

Similarly,
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: ,