jamietelin jamietelin - 1 year ago 79
PHP Question

Are there any length limits on PHP echo?

I have this script that fetches some data from mysql and then uses echo to output it.
But, as the page have grown and gotten longer all of a sudden i have this weird behavior where it cuts of the end at 65535 chrs (when using strlen to check)

The data is all saved in MySQL, beyond the 65535 chrs showing when using echo.

EDIT: Sorry, it seems like NOT all data was saved, it was my WYSIWYG editor that made it look like all was saved but it wasent. (It auto closed unclosed tags making it look all ok when i opend the content again.)

Why is this happening?

All I do is;

$content= $row['content'];
echo $content;

Answer Source

Are you sure it's a PHP issue? The MySQL TEXT field has a maximum size of 65535 characters. Make sure the text is actually in your database.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download