Skip to content

Commit 8fbd122

Browse files
committed
Update HTMLHelper.php
1 parent cb8c0c2 commit 8fbd122

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

berry/utils/HTMLHelper.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ public function __construct()
1717
*/
1818
public function GetAllTagsFromHTMLString(string $tag, string $html)
1919
{
20-
$imgs = array();
21-
preg_match_all('/<' . $tag . '[^>]+>/i', $html, $result);
22-
for ($i = 0; $i < sizeof($result); $i++)
20+
$images = array();
21+
$regexResult = array();
22+
preg_match_all('/<' . $tag . '[^>]+>/i', $html, $regexResult);
23+
for ($i = 0; $i < sizeof($regexResult[0]); $i++)
2324
{
24-
$imgs[$i] = $result[0][$i];
25+
$images[$i] = $regexResult[0][$i];
2526
}
26-
return $imgs;
27+
return $images;
2728
}
2829
}
2930

0 commit comments

Comments
 (0)