- 13, May 2024
- #1
По какой-то причине последний массив возвращает NULL. Предполагается, что он будет возвращать «H11»:
<?php
$all_description_blb = array();
$all_etymologyStrongs = array();
$string1 = "";
$string2 = "";
$string3 = "";
$string4 = "";
$blbdescription = "<span style=\"color: red; font-weight: bold;\"> The same as <a class=\"nowrap\" href=\"lexicon.cfm?strongs=H9&t=KJV\" title=\"English: lost thing, that which was lost\"><span class=\"Hb\">אֲבֵדָה</span> (H9)</a>, incorrectly written for <a class=\"nowrap\" href=\"lexicon.cfm?strongs=H11&t=KJV\" title=\"English: destruction\"><span class=\"Hb\">אֲבַדּוֹן</span> (H11)</a> </span>";
preg_match_all("#<\b(a)\b[^>]*>(.*?)</\b(a)\b>#si", $blbdescription, $stripatag, PREG_SET_ORDER);
array_push($all_description_blb, $blbdescription);
$string1 .= "-----<br /><br />\n";
$string1 .= "stripatag <pre style=\"color: red; font-weight: bold;\">";
//var_dump($stripatag);
$string2 .= "</pre> ";
$string2 .= "<br /><br />\n";
$string3 .= "-----<br /><br />\n";
$string3 .= "stripbracketsforetymstrongsarray <pre style=\"color: red; font-weight: bold;\">";
$string4 .= "-----<br /><br />\n";
$string4 .= "stripatag [0][2] <span style=\"color: green; font-weight: bold;\">".$stripatag[0][2]."</span><br /><br />\n";
$string4 .= "stripatag [1][2] <span style=\"color: green; font-weight: bold;\">".$stripatag[1][2]."</span><br /><br />\n";//Notice: Undefined offset: 1 in C:\xampp\htdocs\biblewheel\update_outline\index.php on line 228
$string2 .= "---------------------------------------------------------------<br /><br />\n";
for($a=0;$a<count($stripatag);$a++){
preg_match_all("/.*\(([^)]*)\)/", $stripatag[$a][2], $stripbracketsforetymstrongsarray, PREG_SET_ORDER);
$etymologyStrongs = $stripbracketsforetymstrongsarray[$a][1];//$href[$a][2] or $href3array[$a][2]?
array_push($all_etymologyStrongs, $etymologyStrongs);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL='https://lumtu.com/yti/dk55kdGRodHRwOi8vdzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwxLXRyYW5zaXRpb25hbCh52']http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/URL]">
<html xmlns="[URL='https://lumtu.com/yti/b0hh0bWxodHRwOi8vdzMub3JnLzE5OTkveGvkT']http://www.w3.org/1999/xhtml[/URL]">
<head>
<meta http-equiv="Content-Type" content="текст/html; кодировка = utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
echo $string1;
var_dump($stripatag);
echo $string2;
echo $string3;
var_dump($all_etymologyStrongs);
echo $string2;
echo $string4;
?>
</body>
</html>
PHP: