$_POST= Array ( [0] => aaa@gmail.com [1] => bbb [2] => ccc [3] => ddd [4] => eee [5] => fff [6] => ggg [7] => hhh [8] => iii [9] => jjj [10] => 31 [11] => k ) foreach($_POST as $key => $val){ for ($key = 0; $key <= 9;$key++){ $_POST2[$val] = htmlentities($_POST[$val]); […]
У меня есть эта функция, чтобы каждый тег img имел абсолютный URL: function absoluteSrc($html, $encoding = 'utf-8') { $dom = new DOMDocument(); // Workaround to use proper encoding $prehtml = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset={$encoding}\"></head><body>"; $posthtml = "</body></html>"; if($dom->loadHTML( $prehtml . trim($html) . $posthtml)){ foreach($dom->getElementsByTagName('img') as $img){ if($img instanceof DOMElement){ $src = $img->getAttribute('src'); if( strpos($src, 'http://') […]