$cfg['Servers'][$i]['auth_type'] = 'cookie';$cfg['Servers'][$i]['auth_type'] = 'config';<?php
$count_query = @mysql_query("select pid from portfolio where category=". $cid);
$pids = array();
if ($count_query) {
while ($count_result = @mysql_fetch_array($count_query)) {
$pids[] = $count_result['pid'];
}
}
?><?php
$mydata = 'this is @ test & Strings';
$mydata = preg_replace("/[^a-zA-Z0-9s]/", "", $mydata);
//print $mydata; will output "thisistestStrings"
?><style type="text/css">
.search_highlight {
background-color:#ffffcc;
}
<?php
$keywords = <SEARCH KEYWORD>; //Keyword to highlight.
$searchresults = <RETURNED STRING>; //Result of search.
preg_replace("|($keywords)|Ui", "<span class='search_highlight'>$1</span>", $searchresults);
?> <?php
include 'Browser.php';
$getbrowser= new Browser();
$browser_name = $getbrowser->getBrowser();
$browser_version = $browser->getVersion();
//You can use $browser_name and $browser_version in conditions to excute code in specific browsers
?>
<?php
$your_date = '2011-05-20';
//You need to increment it by 2 day
//Convert to time stamp first
$your_date_ts = strtotime($your_date);
//Increment By 2 Day
$your_date_dt = strtotime('+2 day', $your_date_ts);
echo date('Y-m-d', $your_date_dt);
//Increment By 2 Week
$your_date_tw = strtotime('+2 week', $your_date_ts);
echo date('Y-m-d', $your_date_tw);
//Similar process is followed for decrement just user -2 day or -2 week in place of +1 day or +1 week
//Decrement By 2 Day
Create a file download.php like below
<?php
// The file path where the file exists
$filepath = "http://mohitsharma.net/downloads/".$_GET['filename']."";
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
//setting content type of page
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".basename($filepath ));
header("Content-Description: File Transfer");
/ <?php
function remove_element($arr_content,$arr_value) {
return array_values(array_diff($arr_content, array($arr_value)));
}
?><?php
$domain = fetch_domain_name('http://www.facebook.com');
print $domain; //it will output "facebook"
function fetch_domain_name($path){
$check = preg_match("/(.*:\/\/)\w{0,}(.*)\.(.*)/", $path, $output);
$output[2] = str_replace(".","",$output[2]);
return $output[2];
}
?>