A
A
Aison2020-07-25 04:31:12
PHP
Aison, 2020-07-25 04:31:12

Why is only one value displayed in this example?

Guys, I created such a construction for additional fields, there should be an output of several values ​​​​separated by commas, but it displays only one value (someone poke my nose

if ($value[3] == 'select') {
    $temp_array = explode(',', $xfieldsdata[$value[0]]);
    $value3 = $value4 = [];
    $optionsXf = explode("\r\n", $value[4]);
    foreach ($optionsXf as $indexxf => $valuexf)  {
        $valuexf1 = explode("|", $valuexf);
        if (!$valuexf1[1]) {
            $valuexf1[1] = $valuexf1[0];
        }
        if (in_array($valuexf1[0], $temp_array)) {
            $valuexf1[1] = str_replace("'", "'", $valuexf1[1]);
           	$valuexf1[0] = str_replace("'", "'", $valuexf1[0]);
            $value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" .$value[0]."/". urlencode($valuexf1[0]) . "/\">" . $valuexf1[1] . "</a>";
            $value4[] = "<span>" . $valuexf1[1] . "</span>";
        }
    }
    
    if ($value[6]) {
        $xfieldsdata[$value[0]] = implode($value[21], $value3);
    } else {
        $xfieldsdata[$value[0]] = implode($value[21], $value4);
    }
    
    $value[6] = false;
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question