Raflianrizqi Ukasah Raflianrizqi Ukasah - 1 year ago 103
PHP Question

how to remove symbol ("_") & (^) on php?

i want to remove

from output this code

foreach( $objYahooStock->getQuotes() as $code => $stock)
$stock[0] = preg_replace('/_.*/','',$stock[0]);

Symbol : <?php echo $stock[0]; ?> <br />
Name : <?php echo $stock[1]; ?><br>
Realtime Last Price : <?php echo $stock[2]; ?><br>
Change Realtime : <?php echo $stock[3]; ?>

i tried use
but still not working to remove

This is My output

Answer Source

Use a str_replace on those two characters and replace with nothing.

$string = str_replace(array("_","^"), "", $string);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download