Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74210

Replace specific value with a string inside a tag on a foreach loop

$
0
0

I'm trying to replace a query field-specific value with a string. Actually my code shows the string at a side of the value.

Code:

foreach ($fieldquery as $key) {
    $color = ( $key['Oportunidad_Minutos'] >= 60 ) ? 'text-danger' : 'text-success';
    $message = ( $key['Oportunidad_Minutos'] >= 10000 ) ? 'A la espera de Triage' : '';
    $table .= '<tr>'
 . '<td scope="row"><span  class="'.$color.'">'. $key['Oportunidad_Minutos']. $message . '</span></td>'
    . '</tr>';
}
$table .=  '</table>';
$table .= "<script>var i = 0; setTimeout(()=>{location.reload();},100000);</script>"; 

print($table); 

I need to replace the value if is equal or greater than 100000 or make the value not visible... Any suggests? Thanks


Viewing all articles
Browse latest Browse all 74210

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>