Jump to content

Replacing a phrase containing a variable


etrader

Recommended Posts

same thing. neither the length of the string or other content in the string matter.

 

<?php
$string = 'AS FASDGASPING asdg aosgiha sgasgoiasrog rag 09u0er70   asr gas "Note: some description" asdga0idsajg0 s0gasrgho aisg';
$string = str_replace('"Note: ','(', $string);
$string = str_replace('"',')', $string);

echo "string: $string";
?>

output:
string: AS FASDGASPING asdg aosgiha sgasgoiasrog rag 09u0er70 asr gas (some description) asdga0idsajg0 s0gasrgho aisg

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.