六月 24, 2022 • 沒有評論 PHP Snappy Starter Sample Code on Windows XAMPP

<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); require 'vendor/autoload.php'; use Knp\Snappy\Pdf; $snappy = new Pdf('C:\"Program Files"\wkhtmltopdf\bin\wkhtmltopdf.exe');…

閱讀內文
六月 23, 2022 • 沒有評論 WordPress Ajax Get Remote Image Hook

<?php function ajax_get_remote_image(){ // Endpoint: /wp-admin/admin-ajax.php?action=ajax_get_remote_image&q= $tmphtml = ''; if ( !isset($_GET["q"]) ) exit; $url...

閱讀內文
六月 2, 2022 • 沒有評論 PHP Turn On Error Display

Within PHP File ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); Within php.ini display_errors = on Within .htaccess...

閱讀內文
五月 28, 2022 • 沒有評論 PHP Check Script Execution Time

<?php $check_execution_start = microtime(true); // Running your script here $check_execution_end = microtime(true); $execution_time = ($check_execution_end...

閱讀內文
五月 25, 2022 • 沒有評論 PHP Simple HTTP Get Function

function imnobby_simple_http_get($url){ $curl = curl_init(); if (!$curl) { die("Couldn't initialize a cURL handle"); } curl_setopt($curl,...

閱讀內文
五月 25, 2022 • 沒有評論 WordPress Admin Ajax Example Script

// Put in functions.php function imnobby_ajax_get_data(){ // Endpoint: /wp-admin/admin-ajax.php?action=imnobby_ajax_get_data $tmphtml = 'produce some output here';...

閱讀內文