Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged url
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Many scripts rely on `$_SERVER[SCRIPT_URL]` which is sometimes missing. This function detects it from other server variables and fixes the missing field.
1
1924
posted 15 years ago by drwitt
This is how to use the $sf_request in a view to build the current base url, including the application file used to build the script.
0
1187
posted 15 years ago by cburyta
The first function make short urls.
The second function decode a short url with CURL. It gets the http header of the short url page. If the header contains a "Location:" header, then it's a redirect, and the decoded url is the url in the "Location"...
1
2100
posted 15 years ago by ginoplusio
This script will return the URL for the current page you're on, including category and tag pages.
3
1765
posted 15 years ago by jonhenshaw
I added this code in the ModuleNews.php file on line 310 - 314.
0
1030
posted 15 years ago by kahlil
This function converts URLs and e-mail addresses within a string into clickable hyperlinks.
0
1093
posted 15 years ago by paulgrenwood
This function converts URLs and e-mail addresses within a string into clickable hyperlinks.
2
1300
posted 16 years ago by Mithun
gibt die url plus storeview aus, also bspw:
http://yourdomain.com/de/
0
982
posted 16 years ago by nico65
this function formats a web address for use in a link.<br>
echo formatWebAddress("google.com");<br>
http://www.google.com/
1
1004
posted 16 years ago by jlvallelonga
Example
Running:
alphaID(9007199254740989);
will return 'PpQXn7COf' and:
alphaID('PpQXn7COf', true);
will return '9007199254740989'
Easy right?
1
1512
posted 16 years ago by localhorst
this function processes a URL that 'should' be a full url (i.e. http://something.com/dfsdfs/)
and makes sure it contains http:// for easy inclusion as a link into a href attribute
0
902
posted 16 years ago by iloveitaly
this is how to automatically get short urls for your blog posts in wordpress,
What you need
is to decide which tinyurl service you will be using and get its api URL,
for example rinyurl.com , bit,ly, tr.im,
here are the api URLS for the mo...
0
1286
posted 16 years ago by nerdsane
Affects <A> tags for links starting with $link
Example: LinkReplacer ($text, 'http://www.snipplr.com') affects to
<a href="http://www.snipplr.com">Snipplr</a>
and <a href="http://www.snipplr.com/blog">Snipplr Blog</a>
0
1188
posted 16 years ago by kossmoss
Alternative to
[http://snipplr.com/view/12616/strip-url-to-its-domain-name/](http://snipplr.com/view/12616/strip-url-to-its-domain-name/, "this snippet"), as it didn't come out clearly in the comments.
Update - Edited based on gdvickery's commen...
3
1461
posted 16 years ago by duniyadnd
Is.Gd is a URL-shortening service much like TinyURL. Using PHP’s cURL library, you can create shortened URLs on the fly with ease. “is.gd†is much shorter than “tinyurl.com†so if you need the URL to be as short as possible, use this method...
0
1178
posted 16 years ago by nerdsane