errors Alerts and using str_replace “ within double quoted string
2 posts by 1 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 24, 2017 (RSS)
By Twocans - July 24, 2017 - edited: July 24, 2017
Hi yea,
I have to do a string replace on a login error as the site is multilingual
The issue I have is working with the "" in the error below.
Password found in list of "most common passwords ", please choose a more secure password.
$errorsAndAlerts = str_replace('Password found in list of "most common passwords ", please choose a more secure password.', "{$record['cpw']}", $errorsAndAlerts);
The above does not work
$errorsAndAlerts = str_replace("Password found in list of \"most common passwords\", please choose a more secure password.", "{$record['common_pw']}", $errorsAndAlerts);
I have tried using an escape key but wowa that didn't work either. I am open to suggestions as how to have a more constructive stab at it.
Am grateful for any input.
cheers
Kenny
By Twocans - July 24, 2017
wow thank you, I managed it using " aka see below
$errorsAndAlerts = str_replace("Password found in list of "most common passwords", please choose a more secure password.", "{$record['common_pw']}", $errorsAndAlerts);
cheers
Kenny