Hi guys, I am currently building a webpage that gets data from a database but then i "echo" it from the array to show my result. I wanted to know if anyone can help me write some code to limit the returned result (i can do it with sql, but doesn’t give the desired result) but for it to cut off the result in the last space before the limit is reached? any ideas? cheers steve
Well, you can count() the items in the array, if it's less than what you want then just return the usual data, if not you can use array_splice() as mentioned above
So if my array looked like.. array( [0] = 1 [1] = my name is steve and i went to the shop ) and then how say do i slice [1] down to "my name is steve" with the array_splice() and count i can only find examples of people adding things in. regards steve