Welcome Guest, Not a member yet? Register   Sign In
str_replace with constants not working...
#1

[eluser]Iverson[/eluser]
Anyone have an idea why this might not be working? I understand that I'm using constants, but I thought PHP would recognize what I was trying to do...

Code:
$fake_vars[] = VAR_COMPANY_NAME; // VAR_COMPANY_NAME is '%company-name%'
$real_vars[] = $company['name'];

// EMAIL_SUBJECT_NEW_CUSTOMER is "Welcome to %company-name%"
$subject = str_replace($real_vars, $fake_vars, EMAIL_SUBJECT_NEW_CUSTOMER);
#2

[eluser]xwero[/eluser]
I wonder why you need a EMAIL_SUBJECT_NEW_CUSTOMER constant? why not put the line it in a language file?
#3

[eluser]Thorpe Obazee[/eluser]
You probably need config file for storing those type of information.




Theme © iAndrew 2016 - Forum software by © MyBB