<?php
$handle = curl_init();
$url = "https://www.memrise.com/course/126065/a1-german-2/1/";
$url = "https://www.memrise.com/course/427841/german-studio-d-a1-vocabulary/3/";
$pattern = `#<div class="text">(.*?)<\/div>#`;
// $pattern = /text">((.|\n)*?)</;
// Set the url
curl_setopt($handle, CURLOPT_URL, $url);
// Set the result output to be a string.
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($handle);
curl_close($handle);
file_put_contents("result.html",$output);
echo "written";
// echo $output;
preg_match_all($pattern, $output, $matches);
print_r($matches);