Skip to content

Instantly share code, notes, and snippets.

@ifirmawan
Created July 9, 2018 02:42
Show Gist options
  • Save ifirmawan/ea16e9be97f6fe15cf159369ba4e1d00 to your computer and use it in GitHub Desktop.
Save ifirmawan/ea16e9be97f6fe15cf159369ba4e1d00 to your computer and use it in GitHub Desktop.
Open html file to get content inside the tags
<?php
$file = 'index.html';
$handle = @fopen($file, "r");
$content = '';
if ($handle) {
while (!feof($handle)) {
$buffer = fgetss($handle, 4096);
$content .= $buffer;
}
fclose($handle);
}
$pieces = explode('(What is this?)',$content);
var_dump($pieces);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment