Reset Auto Increment (using PHP)
Run the following Query: ALTER TABLE tablename AUTO_INCREMENT = 1
Run the following Query: ALTER TABLE tablename AUTO_INCREMENT = 1
With this script you can display how much this Time this page has taken to load. <?php // Insert at the start of your document $time = round(microtime(), 3); // Insert at the end of your document $time2 = round(microtime(), 3); $generation = $time2 – $time; echo “This page took $generation seconds to render”; ?>
You can fetch data from a webpage by using this script. It is useful when you need to fetch data like Stock Rates on your site. Like if you want to fetch data between span tags. <?php // retrieve htmltagcontent tag contents function get_htmltagcontent($file){ $h1tags = preg_match_all(‘/(<span>)(.*)(</span>)/ismU’,$file,$patterns); $res = array(); array_push($res,$patterns[2]); array_push($res,count($patterns[2])); return $res; } … Read more
<?php function getTitle($url) { $fh = fopen($url, “r”); $str = fread($fh, 5000); fclose($fh); $str2 = strtolower($str); $start = strpos($str2, “<title>”)+7; $len = strpos($str2, “</title>”) – $start; return substr($str, $start, $len); } ?>
<?php $url=”http://example.com”; echo getTitle($url); function get_page_title($url) { if( !($data = file_get_contents($url)) ) return false; if( preg_match(“#<title>(.+)</title>#iU”, $data, $t)) { return trim($t[1]); } else { return false; } } ?>
<?php function getTitle($Url){ $str = file_get_contents($Url); if(strlen($str)>0){ preg_match(“/<title>(.*)</title>/”,$str,$title); return $title[1]; } } $url=”http://example.com”; echo getTitle($url); ?>
<?php function curPageURL() { $pageURL = ‘http’; if ($_SERVER[“HTTPS”] == “on”) {$pageURL .= “s”;} $pageURL .= “://”; if ($_SERVER[“SERVER_PORT”] != “80”) { $pageURL .= $_SERVER[“SERVER_NAME”].”:”.$_SERVER[“SERVER_PORT”].$_SERVER[“REQUEST_URI”]; } else { $pageURL .= $_SERVER[“SERVER_NAME”].$_SERVER[“REQUEST_URI”]; } return $pageURL; } ?> <?php echo curPageURL(); ?>
<?php function urlQUERY($url) { $url_data = parse_url ($url); if (!$url_data) return FALSE; $path =”; $query =”; if (isset( $url_data[‘path’])) $path .= $url_data[‘path’]; if (isset( $url_data[‘query’])) $query .= ‘?’ .$url_data[‘query’]; echo “$path $query “; } $url=”Enter Your URL”; urlQUERY($url)); ?>
By using the following script you can retrieve a page name. <?php function curPageName() { return substr($_SERVER[“SCRIPT_NAME”],strrpos($_SERVER[“SCRIPT_NAME”],”/”)+1); } echo “The current page name is “.curPageName(); ?>
Now use the =GETURL(cell) to get the URL Example: =GETURL(A1) will return the URL for the Hyperlink displayed in cell A1 Function GETURL(HyperlinkCell As Range) GETURL = HyperlinkCell.Hyperlinks(1).Address End Function