包装字符串PHP

I have a problem with my code, i have this code that create image from external source of image & string. I used json to get the string.

My problem is if i used the string from json data i could not get the proper wrapping of string like this:

http://prntscr.com/dbhg4n

            $url = 'https://bible-api.com/Psalm100:4-5?translation=kjv';

            $JSON = file_get_contents($url);
            $data = json_decode($JSON);
            $string  = $data->text;

But if i declare and set string directly i got the output that i want like this:

http://prntscr.com/dbhg7q

$string = "Enter into his gates with thanksgiving, and into his courts with praise: be thankful unto him, and bless his name. For the Lord is good; his mercy is everlasting; and his truth endureth to all generations.";

I dont think the error or the problem is on the code for wrapping the text on my image. I think it is on the json data. How can i fix this?

The text has symblols. Just replace them:

$string = preg_replace("/
/", ' ', $data->text);

or without a regular expression:

$string = str_replace("
", ' ', $data->text);