if (!isset($_GET['storeid'])) {
        echo "Failed - you must pass a storeID at the end of the url";
        exit;
    }
    if (!is_numeric($_GET['storeid'])) {
        echo "ERROR: storeid may only be a number.";
        exit;
    }
    $storeid = $_GET['storeid'];
}
//Optional: menudelim (1 character) parameter, default ">"
//Optional: filedelim (1 character) parameter, default ","
//Ex1: ecwid_export_categories.php?storeid=123&menudelim=/&filedelim=;
include 'ecwid_product_api.php';
$api = new EcwidProductApi($_GET['storeid']);
$categories = $api->get_all_categories();
function escape_csv_value($value)
{
    $value = str_replace('"', '""', $value);
    // First off escape all " and make them ""
    if (preg_match('/,/', $value) or preg_match("/\n/", $value) or preg_match('/"/', $value)) {
        return '"' . $value . '"';
        // If I have new lines or commas escape them
    } else {
        return $value;
        // If no new lines or commas just return the value
    }
}
//Build Breadcrumb Description Array
$breadcrumbs = '';
foreach ($categories as $category) {