URL Shortening for long URLs
This snippet requires a 3rd party service to work.
It will take your url, such as: http://phpsnips.com
and convert it to a shorter URL such as:
http://m8.to/BA
<?php
$long_url = "http://www.
This snippet requires a 3rd party service to work.
It will take your url, such as: http://phpsnips.com
and convert it to a shorter URL such as:
http://m8.to/BA
<?php
$long_url = "http://www.
<?php
function array_repeated($array){
if (!is_array($array))
return false;
$repeated_values = Array();
$array_unique = array_unique($array);
if (count($array) – count($array_unique)
<?php
function romanNumerals($num){
$n = intval($num);
$res = ”;
/*** roman_numerals array ***/
$roman_numerals = array(
‘M’ => 1000,
‘CM’ => 900,
‘D’ => 500,
‘CD’ => 400,
Please delete cuz i haven’t finished the code yet
File: class_auth.php
<?php
/*
#
# Copyright Iulian Ciobanu (CIGraphics) 2009
# Email: cigraphics@gmail.com
# Please leave the copyright and email intact.
#
# DATABASE TABLE:
CREATE TAB
<?php
function to_link($string){
return preg_replace("~(http|https|ftp|ftps)://(.*?)(\s|\n|[,.?!](\s|\n)|$)~", ‘<a href="$1://$2">$1://$2</a>$3’,$string);
}
$html = ‘This line of text has three
<?php
include ‘incl/db.php’; // Include the database
// Set the page, use one if the get page is not a number or is negative
if(!isset($_GET[‘page’]) || !ctype_digit($_GET[‘page’]))
$page = 1
<?php
function return_between($string, $start, $stop){
$st = $string;
$list = array();
for($i=0;$i<strlen($string);$i++){
$temp = strpos($st, $start);
$str = substr($st, $temp+1);
$spl
<?php
function page_rank($page, $type = ‘alexa’){
switch($type){
case ‘alexa’:
$url = ‘http://alexa.com/siteinfo/’;
$handle = fopen($url.$page, ‘r’);
break;
case ‘google’:
$url
<?php
$variable = ‘Hello Kitty!’;
if($variable == ‘Kitty’){
echo ‘Goodbye Kitty.’;
}else{
// Note the extra space before "How"
// Remove it and then see what happens…
echo $vari