Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Arrays - storing over 256 characters.

Status
Not open for further replies.

MrBeatnik

Programmer
Feb 4, 2005
3
GB
Hi folks! Can you help:

I am need to store data to be passed later on in the PHP code, but the data is over 256 characters. If there an alterative? I need three arrays, each with 31 keys (1-31).

The data will eventually be passed to a mysql insert statement.

Thanks
 
Where did you come up with a 256 char limitation?
 
Well, during my testing I noticed the characters missing from some strings.


Syntax
Specifying with array()
An array can be created by the array() language-construct. It takes a certain number of comma-separated key => value pairs.

array( [key =>] value
, ...
)
// key may be an integer or string
// value may be any value
---------------------------------------------------

String can only contain 256 characters, integer is no use either.
Ideally, I need to declare the key as something other than string, but don't know if this is possible, so if not possible, is there an alternative?
 
Where do you see that a string "can only contain 256 characters"?

On the page it states:
Note: It is no problem for a string to become very large. There is no practical bound to the size of strings imposed by PHP, so there is no reason at all to worry about long strings.

Ken
 
Ok, thanks. I wasn't reading the information correctly. I am loading the information from an XLS sheet - it seems that my code there may be the problem then, and its not passing across the full information, coincidentally stopping at 256 chars.

I was sure that it was reading it all correctly before, which is why I looked at the array issue, but I was obviously wrong. I've never used arrays before holding so much data.

Thanks again for clearing that up!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top