Are there length restrictions for echo PHP?

I have this script that extracts some data from mysql and then uses echo to output it. But, as the page grew and got more time, I got this weird behavior when it ends at 65535 chrs (when using strlen to check)

All data is stored in MySQL, beyond 65535 chrs, showing when using the echo.
EDIT: Sorry, it looks like NOT all data was saved, it was my WYSIWYG editor that made it look like everything, but everything was saved. (It automatically closes closed tags, making it look normal when I open the contents again.)

Why is this happening?

All I do is:

$content= $row['content']; echo $content; 
+4
source share
2 answers

Are you sure this is a problem with PHP? The MySQL TEXT field has a maximum size of 65535 characters. Make sure the text is actually in your database.

+7
source

Of course, this sounds like a length limit. You can always try something like this:

 $content = str_split($row['content'], 65536); foreach ($content as $part) { echo $part; } 
-1
source

Source: https://habr.com/ru/post/1301445/


All Articles