Blog > detail

Just my tiny mind

Code Compressor

26-2-2012 Admin General 2 Comments

Code Compressor

Code Compressor is a simple code to minimalize all type of code. Code Compressor will scrap new line and redundant space, and Code Compressor can work for mant type of code. I have tried to compress PHP code, css code, HTML code and Javascript code and it work successfully. However, this Code Compressor has drawback. It will error if it found comment like "//" in PHP or javascript. But dont worry, I am working on this. This Code Compressor is absolutely made 100% by my self :D, so there is no plagiarism in it.


First, The HTML Code:


Code Compressor by Muhammad Hasan Septiadi


Second, The PHP code as the engine:


/*This code made by Muhammad Hasan Septiadi*/

if(isset($_POST['source']))

{

echo "

Result";

echo htmlspecialchars(trim($_POST['source']));

echo "

";

}


You can combine both of code into one file, that should be like:


Code Compressor by Muhammad Hasan Septiadi

/*This code made by Muhammad Hasan Septiadi*/

if(isset($_POST['source']))

{

echo "

Result";

echo htmlspecialchars(trim($_POST['source']));

echo "

";

}

?>


If we use the Code Compressor for our code, it should be:


Code Compressor by Muhammad Hasan Septiadi

Result"; echo htmlspecialchars(trim($_POST['source'])); echo ""; } ?>


Done, we just make a really simple Code Compressor.


Good luck.


Related Posts:


Code Compressor Ver 2


Code Compressor Code Compressor Code Compressor

Code Compressor Code Compressor Code Compressor

Code Compressor

word word

Code Compressor

Code Compressor

Code Compressor