A section of code execution issues
PHP Code
805) {$h = ($m [2]*805)/$m [1]; $k = 805; $ptext = Preg_replace ('/(width=) ' (\d+) "(\s*height=)" (\d+) "/I", ' $ '. $k. ' $ "'. $h. '" ', $m); } mysql_query ("Set names ' GBK '"); $sql = "Update pagecontents set Page_text = (' {$ptext} ') Where page_id = (' {$pid} ')"; mysql_query ($sql) or Die (Mysql_error ());}? >
The result is that 2 sentences have been executed.
HTML Code
Part Page_text////
What was meant to be done was to change the width over 805, which was the first one, and all the results were replaced.
------Solution--------------------
$m [1] returns all matching content.
Print_r, look, you'll know.
------Solution--------------------
The problem hasn't been solved yet? You posted a few paragraphs. In the end, that paragraph is the standard. The question is not clearly described.
------Solution--------------------
Remember I wrote you a code.
PHP Code
$page _text =<<< TXT txt;echo preg_replace_callback (' #width = "(\d+)" \s*height= "(\d+)" #i ", ' Back ', $page _ text);//$m [1] is the value of width, $m [2] is the value of height. function back ($m) { if ($m [1]>805) { $h =round ($m [2]*805)/$m [1]); $k =805; Return "width=\" $k \ "height=\" $h \ ""; } return $m [0];}