Skip to content

Instantly share code, notes, and snippets.

@samuelguebo
Created September 24, 2018 09:05
Show Gist options
  • Save samuelguebo/edc76418afd34ae2aa1557bd9d9b0ccd to your computer and use it in GitHub Desktop.
Save samuelguebo/edc76418afd34ae2aa1557bd9d9b0ccd to your computer and use it in GitHub Desktop.
Array of 5000 Spanish Sentences Sorted from Easiest to Hardest
<?php
$rawUrl = "https://pastebin.com/raw/fjmQKxnQ";
$rawText = file_get_contents($rawUrl);
$lines = preg_split("/\r\n|\n|\r/", $rawText);
$lines_count = count($lines);
$output = array();
$i = 0;
for($j = 0; $j<$lines_count; $j++){
if($j==$i){
if($j+1<$lines_count){
$output[] = array('es' => $lines[$i], 'en' => $lines[$i+1]);
$i = $i+5;
}
}
}
print_r($output);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment