PHP display all errors and warnings
When writing a program in PHP it is a good idea to activate all the errors and warnings that often occur during development. Many hosts have the display of errors disabled, so you can ‘go…
When writing a program in PHP it is a good idea to activate all the errors and warnings that often occur during development. Many hosts have the display of errors disabled, so you can ‘go…
Our API is a free solution for converting web pages and HTML documents to PDF with PHP. Here is a simple example: <?php $data = array(“apikey” => “YOUR_API_KEY”, “html” => “<p>My first pdf with <b>.Maui…
It’s really simple to minify multiple Javascript files in a folder with .Maui APIs and PHP. Copy and paste the following snippet of code, insert your API key, specify folder paths in $paths array and run the PHP…
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, ‘https://www.example.com/sitemap.xml’); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); curl_setopt($ch,CURLOPT_USERAGENT,’Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36′); $resp = curl_exec ($ch); $xml = new SimpleXMLElement($resp); foreach ($xml->url…
<?php // Your Script here. $time = microtime(true) – $_SERVER[“REQUEST_TIME_FLOAT”]; echo “Execution Time: {$time}”; // Execution Time: 1.5140309333801
Here is a simple function to prevent Sql Injection with PHP. Just recall it and check both GET and POST parameters <?php function checkInjection() { $badchars = array("DROP", "SELECT", "UPDATE", "DELETE", "INSERT", "TRUNCATE", "UNION ALL",…
.Maui Image Resizing API is a useful tool for creating thumbnails for your applications. Resize an image with PHP is damn easy, it’s free and without any form of advertising. Download the client from GitHub…
Remove script tags (or other types of tags) from a string in PHP is really easy, here’s how: <?php $html = <<<HTML <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="https://cdn.dotmaui.com/dotmaui/css/dark.css" /> <script> alert('1') </script> <script…
To process files with a .htm or .html file extension as PHP files you must add the following line to the file.htaccess (if this file does not exist, create it on the site ROOT). AddType…
Here is a small class in PHP to write log files. If the file name is not specified, it will be assigned by the script. <?php class Log { private $PATH; function __construct($file_name = null)…