close

[Solved] ‘ ‘ string literal contains an unescaped line break Error

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error ‘ ‘ string literal contains an unescaped line break Error in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How ‘ ‘ string literal contains an unescaped line break Error Error Occurs?

Today I get the following error ‘ ‘ string literal contains an unescaped line break Error in php.

How To Solve ‘ ‘ string literal contains an unescaped line break Error Error ?

  1. How To Solve ' ' string literal contains an unescaped line break Error Error ?

    To Solve ' ' string literal contains an unescaped line break Error Error have mixed ' and “, so there should be the error. Although that <?php... should not work, because PHP runs on the server and not on the web browser.

  2. ' ' string literal contains an unescaped line break Error

    To Solve ' ' string literal contains an unescaped line break Error Error have mixed ' and “, so there should be the error. Although that <?php... should not work, because PHP runs on the server and not on the web browser.

Solution 1

$('#action').html(...)

and

 $('.titre_ecv').html(...)

have mixed ‘ and “, so there should be the error. Although that <?php... should not work, because PHP runs on the server and not on the web browser.

Edit

That might work:

$('#action').html("<?php echo preg_replace('/\s\s+/', '', $langs->trans('Delete') ); ?>");
$('.titre_ecv').html("<?php echo addslashes(trim(preg_replace('/\s\s+/', '', $langs->trans('ecv_nouveau_formation')))); ?>");

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment