I want to replace as FALSE
where the string contains a #
followed by an integer.
This is my code:
$newlogicexpression = '#1 and (1743327.12 > 10)';
if( strpos( $newlogicexpression, '#' ) !== false ) {
$newlogicexpression = str_replace('#', 'FALSE', $newlogicexpression);
$this->logger->debug($newlogicexpression);
}
My expected result is: FALSE and (1743327.12 > 10)
My current output is: FALSE1 and (1743327.12 > 10)
Based on the post method, the integer that follows the # may differ.
The replacement need to happen at any position in the string.