我有一个包含 html 代码的变量,我想对代码的每一行执行一个操作:
<?php
$html = file_get_contents('http://www.google.com/');
#how i would like it to be (not real commands)
/*
$line = 1
$currentline = readline($html,$line)
line++
where $html is the variable that we want to read a line from
$line is the line number
and $currentline the contents
so if $line is 1 we get that $currentline is <html> or whatever
after that i perform things on that line and continue reading each line untill i read all the lines
*/
?>
我希望你明白我的意思/需要。我对基于网络的编程非常陌生,所以我需要很多解释!
请不要使用您认为 PHP 程序员应该知道的技术术语,因为我可能不知道那是什么。