Home >Backend Development >PHP Tutorial >PHP interview written test questions 1_PHP tutorial
This article shares an article about PHP interview written test question 1. Friends in need can refer to it
* Please implement a function, enter a piece of text, parse the text into an array, and pass the key of each row of the array element Input parameters are specified.
Function prototype: function ExplodeLines($text, $columnNames)
For example, enter:
The code is as follows
|
Copy code
|
||||
Apple,20,red Pear,10,yellow"; $columnNames = array('Fruit', 'Number', 'Color')Function returns: array( array('Fruit'=>'Apple', 'Number'=>'20', 'Color'=>'red'),array('Fruit'=>'Pear', 'Number'=>'10', 'Color'=>'yellow'), )*/
Instance methods
Question 2 Please design a system (database structure and logical flow) to meet the following requirements: 1. Users can correctly obtain the above types of gold coins 2. Users can know how many gold coins they have available for consumption and how many gold coins are frozen at any time 3. The frozen gold coins will become consumable gold coins after the freezing period
|