Why are strings getting cut off in PHP when echoing?
anonymous
2008-08-20 08:41:12 UTC
I'm trying to echo data from a sql database with PHP but if the string is too long, it is cut off at a certain point. I can display the same data in asp and its fine. Is there setting in the PHP.ini file that is doing this?
Three answers:
Chris C
2008-08-20 09:17:45 UTC
Is it possible that the string contains escape characters, or something that might terminate the string by having a double-quote inside of the string that is returned.
Cooper
2008-08-20 15:53:27 UTC
How many characters is the string?
Without seeing some code or getting more detailed information it is hard to answer. It does sound like it is getting truncated though. There shouldn't be any reason to modify the php.ini for this case unless your string is absurdly long.
oopjosh
2008-08-20 16:15:41 UTC
Maybe the string was longer than what that db field can accomodate, so it was truncated when you inserted it?
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.