.Maui Blog

Minify CSS API with PHP

.Maui offers you free APIs to minimize CSS. You will then be able to create your own App without looking at a site every time to minimize CSS.

It is necessary to register at dotmaui.com to get the free api key. To run this example, the CURL library must be enabled.

<?php

$data = array('apikey' => 'YOUR_API_KEY', 
              'url' => "https://dotmaui.com/assets/css/default.min.css");

$curl = curl_init("https://api.dotmaui.com/client/1.0/cssmin/");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 

$output = curl_exec($curl);  

curl_close($curl);

echo $output;
Exit mobile version