url_shorten [ WordPress Function ]
url_shorten ( $url )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Shorten an URL, to be used as link text
Source
<?php
function url_shorten( $url ) {
$short_url = str_replace( 'http://', '', stripslashes( $url ));
$short_url = str_replace( 'www.', '', $short_url );
$short_url = untrailingslashit( $short_url );
if ( strlen( $short_url ) > 35 )
$short_url = substr( $short_url, 0, 32 ) . '...';
return $short_url;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/url shorten « WordPress Codex
Description. Shortens URLs. Removes http://, www., and truncates the remaining URL to 35 characters, including '...' if the URL is longer than that. WordPress ...
codex.wordpress.org - url_shorten.rb - WeeChat :: scripts
s]*') @regexp_url end def url_shorten(server,msg) if (msg.empty?) usage return Weechat::PLUGIN_RC_OK end url = (msg.scan regexp_url).to_s short ...
www.weechat.org - url_shorten.rb - WeeChat
... version 1.1: conversion to WeeChat 0.3.0+ require 'net/http' require 'net/https' require 'uri' SCRIPT_NAME = 'url_shorten' SCRIPT_AUTHOR = 'Daniel Bretoi ...
www.weechat.org - TinyURL.com - shorten that long URL into a tiny URL
Free URL redirection service. Turns a long URL into a much shorter one.
tinyurl.com