Is there something like struct data type in PHP?
Can anyone give me example for struct data type to understand this better?
If there’s no such data type, how can I get a data type that behaves like a struct?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Closest you’d get to a struct is an object with all members public.
I’d say looking at the PHP Class Documentation would be worth it.
If you need a one-off struct, use the StdObject as mentioned in alex’s answer.