php explode function limitations

I have long descriptions stored in the database. Until today I haven’t had any issues with using the explode function to display text on the webpage.

I am noticing that if my descriptions are really long the array cuts off text.

For Example, this is what my array results look like using explode:

Array ( [0] => /path/to/url.php [1] => /image/path/image.jpg [2] => Title [3] => /image/path/image2.jpg [4] => This is the description can be hundreds of characters long, even thousands, [5] => Smaller Description [6] => 6 [7] => Yes )

However, when the description [4] is real long it seems to limit the number of characters to around 1000 total and it looks like this.

Array ( [0] => /path/to/url.php [1] => /image/path/image.jpg [2] => Title [3] => /image/path/image2.jpg [4] => This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousandsThis is the description can be hundreds of characters long, even thousandsThis is the description can be hundreds of characters long, even thousandsThis is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description can be hundreds of characters long, even thousands This is the description ) <— Stops here and doesnt show [5], [6] and [7]

Anybody know what is causing this and how to resolve this issue?

I would prefer not to have to limit the number of characters in in my description [4] field.\

Thanks

Are you certain they are not being cut off in the database? What is the field type?

Yes all of the data is still in the database. I have confirmed. and the datatype is varchar (2500)

Steve

Sponsor our Newsletter | Privacy Policy | Terms of Service