String Replace Problem
Posted: Thu Jul 24, 2008 7:19 am
I have the following code
$formula=((( Basic) * ( 1 + Cess Duty + Excise Duty * ( 1 + Edu-Cess + Sec -Edu-Cess) + Packing & Forwarding) + Packing & Forwarding fixed)+ Commission) * CST against C Form
If i replace 'Edu-Cess' by '0' in the above string using str_replace function then the string becomes
$formula=((( Basic) * ( 1 + Cess Duty + Excise Duty * ( 1 + 0 + Sec -0) + Packing & Forwarding) + Packing & Forwarding fixed)+ Commission) * CST against C Form
I the above string 'Edu-Cess' gets replaced by '0' but also in 'Sec -Edu-Cess' it gets replaced and 'Sec -0' remains which is meaningless.
I want to replace only full string.
Is there any way to replace this using regular expression?
Thanks in advance.
Sandeep
$formula=((( Basic) * ( 1 + Cess Duty + Excise Duty * ( 1 + Edu-Cess + Sec -Edu-Cess) + Packing & Forwarding) + Packing & Forwarding fixed)+ Commission) * CST against C Form
If i replace 'Edu-Cess' by '0' in the above string using str_replace function then the string becomes
$formula=((( Basic) * ( 1 + Cess Duty + Excise Duty * ( 1 + 0 + Sec -0) + Packing & Forwarding) + Packing & Forwarding fixed)+ Commission) * CST against C Form
I the above string 'Edu-Cess' gets replaced by '0' but also in 'Sec -Edu-Cess' it gets replaced and 'Sec -0' remains which is meaningless.
I want to replace only full string.
Is there any way to replace this using regular expression?
Thanks in advance.
Sandeep