Home > Backend Development > PHP Problem > How to define structure in php

How to define structure in php

王林
Release: 2023-02-25 19:30:02
Original
7065 people have browsed it

How to define structure in php

Three ways to define a structure in PHP

1. The first way

struct Student
{
   int age;
   float score;
   char sex;
};
Copy after login

2. The second way

struct Student
{
   int age;
   float score;
   char sex;
}st;
Copy after login

3. The third way

struct
{
   int age;
   float score;
   char sex;
}st;
Copy after login

Recommended tutorial: PHP video tutorial

The above is the detailed content of How to define structure in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template