One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
<?php | |
if (isset($_POST['video_req']) && ! empty($_POST['video_req'])){ | |
if ( preg_match("+youtube.com+", $_POST['video_req']) ) { | |
$video = htmlspecialchars($_POST['video_req']); | |
$strpos_yt = strpos($video, "youtube.com"); | |
$beginning = substr($video, 0, $strpos_yt) ; | |
if ($beginning != "http://www." ) | |
{$video = substr_replace ($video, "http://www.", 0, $strpos_yt ) ;} |
© Copyright <script>document.write(new Date().getFullYear());</script> |
<?php | |
/** | |
* Plugin name: Different theme for guest than logged in user | |
*/ | |
// You can also put this file in mu-plugins dir. | |
add_filter( 'template', 'switch_theme__db' ); | |
add_filter( 'stylesheet', 'switch_theme__db' ); |
<?php | |
class BackupDroplet | |
{ | |
private $apiUrl = 'https://api.digitalocean.com/v2/'; | |
private $token; | |
private $dropletId; | |
public function __construct($token, $dropletId) | |
{ |
<?php | |
// shortcode | |
add_shortcode( 'foobar', 'foobar_func' ); | |
function foobar_func( $atts ){ | |
// php only | |
$recent_posts = wp_get_recent_posts(array( | |
'numberposts' => 3, |
<?php | |
/* | |
* simple HttpRequest example using PHP | |
* tom slankard | |
*/ | |
class HttpRequest { | |
public $url = null; |
<?php | |
function dve_csv_array($csvfile = 'samplecasvdata.csv',$cn=0,$before = '<br/>',$after = '<br/>'){ | |
$csv = array_map('str_getcsv', file($csvfile)); | |
foreach($csv as &$cell){ | |
echo $before.$cell[$cn].$after; | |
} |