I have loaded an external html file into a var using fopen() and fread().
I'm trying to get a value that relates the the character after the <head> tag.
I'm trying to compensate for any white space or attributes that might be added to it.
I'm also trying to avoid a false result from any JavaScript that might be in the file.
as of right now im using
$template = fopen($template_dir, 'r');
$template = fread($template, filesize($template_dir));
$head_pos = stripos($template, '>', stripos($template, 'head', stripos($template, 'html', stripos($template, '<'))))+1
I'm sure there is a more effective way to do this possibly with regex.
any ideas.
thanks in advance