Skip to content

Instantly share code, notes, and snippets.

@curiouscrusher
Last active July 8, 2016 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curiouscrusher/e33918cf6d6f1d2bdc2d078a83985b98 to your computer and use it in GitHub Desktop.
Save curiouscrusher/e33918cf6d6f1d2bdc2d078a83985b98 to your computer and use it in GitHub Desktop.
If you've ever dealt with Product exports of any kind during a migration, you've probably thought something like "Wouldn't it be nice if I could strip out all these HTML tags in here..." Well now you can! Grab this script, insert your CSV names, and off you go!
<?php
$csvFileNoTags = "products-test.csv"; // Name your new CSV file
$f = fopen($csvFileNoTags, 'w'); // Create the CSV file from above
$export = strip_tags(file_get_contents("products.csv")); // Load the CSV file and strip all tags from it
fwrite($f, $export); // Write the new CSV
fclose($f); // Fin
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment