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
1584
posted 14 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
893
posted 14 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
1629
posted 14 years ago by ginoplusio
This script will return the URL for the current page you're on, including category and tag pages.
3
1373
posted 14 years ago by jonhenshaw
This function converts URLs and e-mail addresses within a string into clickable hyperlinks.
0
807
posted 15 years ago by paulgrenwood
This function converts URLs and e-mail addresses within a string into clickable hyperlinks.
2
927
posted 15 years ago by Mithun
gibt die url plus storeview aus, also bspw:
http://yourdomain.com/de/
0
688
posted 15 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
718
posted 15 years ago by jlvallelonga
Example
Running:
alphaID(9007199254740989);
will return 'PpQXn7COf' and:
alphaID('PpQXn7COf', true);
will return '9007199254740989'
Easy right?
1
1133
posted 15 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
660
posted 15 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
898
posted 15 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
866
posted 15 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
1115
posted 15 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
769
posted 15 years ago by nerdsane