<?php class Student { var $str_Name; var $str_Sex; var $int_Id; var $int_English; var $int_maths; function Input ( $Name, $Sex, $Id, $English, $Maths) { $this->str_Name=$Name; $this->str_Sex =$Sex; $this->int_Id =$Id; $this->int_English=$English; $this->int_Maths=$Maths; } function ShowInfo() { echo ("姓名:$this->str_Name<br> "); echo ("性别:$this->str_Sex <br> "); echo ("学号:$this->int_Id <br> "); echo ("英语成绩:$this->int_English <br> "); echo ("数学成绩:$this->int_Maths <br> "); } } $Wing = new Student; $Wing->Input ("Wing","男",33,95,87); $Paladin = new Student; $Paladin->Input ("paladin","女",38,58,59.5); $Wing->ShowInfo(); $Paladin->ShowInfo(); ?>
Defines the human class, including name, gender, student number, English score, math score, etc.
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
19 May 2018
This article mainly introduces the definition and usage of the PDO public class implemented by PHP, and analyzes the PDO operation class definition and query, insertion and other usage techniques implemented by PHP based on specific examples. Friends who need it can refer to it.
06 Feb 2018
This article mainly introduces the definition and usage of the PDO public class implemented by PHP, and analyzes the PDO operation class definition and query, insertion and other usage techniques implemented by PHP in the form of specific examples. Friends in need can refer to it. I hope it can help everyone.
13 Jul 2016
24 useful PHP libraries to share, 24php libraries. 24 useful PHP libraries to share, 24php libraries Currently, PHP is the most popular scripting language used for web development. You can easily find a lot of information about PHP on the Internet, including documentation, tutorials,
13 Jul 2016
15 very practical open source PHP libraries, 15 open source libraries. 15 very practical open source PHP class libraries, 15 open source class libraries The PHP library provides developers with a standard interface, which helps developers make full use of object-oriented programming in PHP. These libraries are specific
15 Jul 2016
20 extremely useful PHP libraries. Below are some very useful PHP libraries, which I believe can provide a better and faster method for your WEB development. Chart libraries The following libraries allow you to easily create complex charts.
29 Oct 2016
Sets the style of an element on mouseover. E elements can be selected through other selectors, such as class selectors, id selectors, type selectors, etc. Special note: IE6 does not support this selector, but it can support :hover of the a element, that is, it only supports :hover of the a element selected through the type selector.
Hot Tools
PHP library for dependency injection containers
PHP library for dependency injection containers
A collection of 50 excellent classic PHP algorithms
Classic PHP algorithm, learn excellent ideas and expand your thinking
Small PHP library for optimizing images
Small PHP library for optimizing images