Simple Machines Community Forum

General Community => Scripting Help => Topic started by: TonyJ on February 23, 2020, 05:55:10 PM

Title: A bit of PHP help, please
Post by: TonyJ on February 23, 2020, 05:55:10 PM
I'm modifying a PHP file, found on the SMF forums, that allows me to import 300 users into the database.

As I don't have their email addresses, as yet, I need to do something like this to complete the importation. Can someone tell me what syntax I need to append Key(4) to the following, please.

    'email' => $key[4], + "@youremail.com"

Thank you.
Title: Re: A bit of PHP help, please
Post by: live627 on February 23, 2020, 06:14:25 PM
string concatenation uses the dot character not the plus sign.
Title: Re: A bit of PHP help, please
Post by: TonyJ on February 23, 2020, 06:20:14 PM
Sorry, but I'm not a PHP coder. :-( Can you show me how the concatenation should look, please.

Quote from: live627 on February 23, 2020, 06:14:25 PM
string concatenation uses the dot character not the plus sign.
Title: Re: A bit of PHP help, please
Post by: vbgamer45 on February 23, 2020, 06:31:17 PM
You would use the . instead of +
So
    'email' =>  $key[4] . "@youremail.com"
Title: Re: A bit of PHP help, please
Post by: TonyJ on March 03, 2020, 10:50:50 AM
Perfect! Thanks very much for your help.  :)