Skip to content

Instantly share code, notes, and snippets.

@zavodnoyapl1992
Last active November 26, 2015 09:31
Show Gist options
  • Save zavodnoyapl1992/3f92e030f008c2513ac8 to your computer and use it in GitHub Desktop.
Save zavodnoyapl1992/3f92e030f008c2513ac8 to your computer and use it in GitHub Desktop.
layout parser primitive example
<?php
$url1 = 'https://vk.com/t_baks';
$url2 = 'https://vk.com/mih_in';
$content = preg_replace("(\n)", "", file_get_contents($url1));
$content2 = preg_replace("(\n)", "", file_get_contents($url2));
preg_match_all("#<head>(.*)<\/head>#i", $content, $head);
preg_match_all("#<head>(.*)<\/head>#i", $content2, $head2);
$match = explode('<',$head[1][0]);
$match2 = explode('<',$head2[1][0]);
$headLayout = array_intersect($match, $match2);
var_dump(array_diff($match, $headLayout));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment