Tommy Cutter

Web, app and game developer.

Month: May 2009

Parse NameCheap domain export file with PHP

Maybe there’s a way to export a excel format? But I got an xml file. Here’s how to parse it as a tab separated format via PHP.

if (file_exists(‘domainlist-11386-10-43.asp.xml’)) {
$xml = simplexml_load_file(‘domainlist-11386-10-43.asp.xml’);
} else {
exit(‘Failed to open domainlist-11386-10-43.asp.xml.’);

echo “<pre>n”;
echo “domaintexpiresn”;
foreach($xml->domains->domain as $row)
echo $row->{“domain-name”}.”t”.date(“m/d/Y”,strtotime($row->{“expire-date”})).”n”;
echo “</pre>n”;

What’s here, but first they have to find them

Listening to Tycho (so good) and getting back to work on freelance/personal projects. For whatever reason, my office chair stopped squeaking, so now I won’t wake Jess up at 2am with a loud *creeeeaaak*.

© 2017 Tommy Cutter

Theme by Anders NorenUp ↑