This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo '<pre>'; | |
print_r($debug_array); | |
echo '</pre>'; | |
exit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//cache file | |
$cachefile = 'cached/'.date('M-d-Y').'.php'; | |
//Total time the file will be cached in seconds set to 10 hours | |
$cachetime = 36000; | |
//If the cache file already exists and the cache file is over 10hours old then display the cache file | |
if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) { | |
include($cachefile); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
readfile('jquery.js'); | |
readfile('general.js'); | |
readfile('jquery-ui.js'); | |
readfile('page.js'); | |
header('Content-type: text/javascript'); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$request = "request=string of request"; | |
// Send using curl | |
$ch = curl_init(); | |
curl_setopt( $ch, CURLOPT_URL, $url); // URL to post | |
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); // return into a variable | |
curl_setopt( $ch, CURLOPT_HTTPHEADER, $header ); // headers from above | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_PORT, 8080); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = ' This is an example string '; | |
echo ltrim($string); // This is display the text This is an example string . | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#selectBox").append('<option value="option6">option6</option>'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$supportedLangs = array('en-GB', 'fr', 'de'); | |
$languages = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']); | |
foreach($languages as $lang) | |
{ | |
if(in_array($lang, $supportedLangs)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Secure /uploads/ directory from unwanted file types | |
<Files ~ ".*..*"> | |
Order Allow,Deny | |
Deny from all | |
</Files> | |
<FilesMatch ".(jpg|jpeg|jpe|gif|png|tif|tiff)$"> | |
Order Deny,Allow | |
Allow from all | |
</FilesMatch> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function login_with_email_address($username) { | |
$user = get_user_by_email($username); | |
if(!empty($user->user_login)) | |
$username = $user->user_login; | |
return $username; | |
} | |
add_action('wp_authenticate','login_with_email_address'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Using the == operator, Strings do not match is printed | |
if('string1' == 'STRING1') | |
{ | |
echo 'Strings match.'; | |
} else { | |
echo 'Strings do not match.'; | |
} |