I am stuck in my PHP experience and completely a newbie in this help, please. So I don't know how to correct this code, if (!isset($dom[$key]['attribute']['size']) AND !isset($dom[$key]['style']['font-size'])) {
@tykus so I closed some array above but got a new error instead on this first line, ( syntax error, unexpected token "else" ) that part of the code starts here below
}
if (!empty($dom[$key]['value']) AND ($dom[$key]['value'][0] == 'h') AND (intval($dom[$key]['value'][1]) > 0) AND (intval($dom[$key]['value'][1]) < 7)) {
// headings h1, h2, h3, h4, h5, h6;
}
if (!isset($dom[$key]['attribute']['size']) AND !isset($dom[$key]['style']['font-size'])) {
$headsize = (4 - intval($dom[$key]['value']{1})) * 2;
$dom[$key]['fontsize'] = $dom[0]['fontsize'] + $headsize;
}
Hi @binlagche, as @tykus said error you have has appeared above this if and this part of the error message should've been a hint :) unexpected token "if", expecting "]" ... so instead of "if" you have to close some array or whatever is above :)
@devSSI so I closed some array above but got a new error instead on the first line, syntax error, unexpected token "else" This is the code }
if (!empty($dom[$key]['value']) AND ($dom[$key]['value'][0] == 'h') AND (intval($dom[$key]['value'][1]) > 0) AND (intval($dom[$key]['value'][1]) < 7)) {
// headings h1, h2, h3, h4, h5, h6;
}
if (!isset($dom[$key]['attribute']['size']) AND !isset($dom[$key]['style']['font-size'])) {
$headsize = (4 - intval($dom[$key]['value']{1})) * 2;
$dom[$key]['fontsize'] = $dom[0]['fontsize'] + $headsize;
}