php manual bookmarklet

Small, short code snippets that other people may find useful. Do you have a good regex that you would like to share? Share it! Even better, the code can be commented on, and improved.

Moderator: General Moderators

Post Reply
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

php manual bookmarklet

Post by rehfeld »

i didnt write this, found it on the net somewhere a long time ago.

its just a simple js that makes looking up functions on php.net a snap

1- create a new bookmark, name it "php manual" or whatever you like
2- paste the following into the address/location of the bookmark field

Code: Select all

javascript:q=document.getSelection();if(!q)void(q=prompt('PHP Reference:',''));if(q)location.href='http://www.php.net/'+escape(q)

personally i just have this bookmark as a button on my browsers toolbar, so when i click it, it makes a popup box and you type in your search term, hit ok and your taken to the results on php.net

hope people find this as usefull as i do.
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

Hey, thanks for the great tip! If you're using Mozilla Firefox, then you can also set the "Keyword" field. I have it set to 'phpman'. So if I want, I can type 'phpman' into the URL field, hit enter, and I see the popup asking for the function name. Very cool!
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

protokol wrote:Hey, thanks for the great tip! If you're using Mozilla Firefox, then you can also set the "Keyword" field. I have it set to 'phpman'. So if I want, I can type 'phpman' into the URL field, hit enter, and I see the popup asking for the function name. Very cool!
Why not just associate your keyword with http://www.php.net ? e.g....

Location: http://www.php.net/%s
Keyword: phpman

The when you type into your address bar 'phpman str_replace' the page for str_replace comes up without having to bring up a popup box.

And for those who haven't noticed, this bookmarklet will allow you to highlight text on the page then click on it to go directly to the corresponding page on php.net (if it exists)
Post Reply