Help a newbie please :)

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
serazoo
New php-forum User
New php-forum User
Posts: 2
Joined: Wed Jan 08, 2020 4:22 pm

Wed Jan 08, 2020 4:44 pm

Hello all, I'm a basic coder 😀
php 7.2
I want to insert a line break in this code, after the {hobby:value} it gives me : syntax error, unexpected '>'

if($_POST['form']['hobby'] == '')
$modUserEmailText = str_replace('{hobby:caption} : {hobby:value}', ''<br/>'',$modUserEmailText);


{hobby:caption} : {hobby:value} are placeholders in the sent email, since there are several of them, all I want is a line break between each.. and must end with $modUserEmailText);

is this possible to do?

{hobby:caption} : {hobby:value}
{age:caption} : {age:value}
{book:caption} : {book:value}

Thanks a million!
chorn
php-forum GURU
php-forum GURU
Posts: 654
Joined: Fri Apr 01, 2016 2:18 am

Thu Jan 09, 2020 12:22 am

Why did you use two single-quotes instead of a double-quote in the second parameter?
serazoo
New php-forum User
New php-forum User
Posts: 2
Joined: Wed Jan 08, 2020 4:22 pm

Thu Jan 09, 2020 4:36 am

I have tried, single and double quotes, in many places in the code... before I came to the forum :(

If you had to put a line break in this one, how do we achieve that?
cheers

if($_POST['form']['age'] != '')
$modAdminEmailText .= '{age:caption}: {age:value}';
Post Reply