How to save the output in xlsx file?

I have created a very simple code that take decimal numbers and convert them to binary and hexadecimal, my goal is to put the result in an excel file, i want to put decimal in a column and binary in a column and same for hexa.

Until now this is my code.

<?php
for ($x = 0; $x <= 100; $x++) {
    echo ($x) . ' ' . decbin($x) . '  ' . dechex($x) . "<br>";
}
?>
Sponsor our Newsletter | Privacy Policy | Terms of Service