Home  >  Article  >  Backend Development  >  How to define structure in php

How to define structure in php

王林
王林Original
2019-10-08 10:00:396949browse

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;
};

2. The second way

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

3. The third way

struct
{
   int age;
   float score;
   char sex;
}st;

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!

Statement:
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
Previous article:How to print array in PhpNext article:How to print array in Php