Installation problem: Parse error: syntax error, unexpected '[' in E:\phpStudy\WWW\myblog\public\tpl\page_tpl.php on line 3
sunten
sunten 2019-03-31 11:39:29
0
6
1394

Parse error: syntax error, unexpected '[' in E:\phpStudy\WWW\myblog\public\tpl\page_tpl.php on line 3

The above problem appears at the bottom, please solve it.

sunten
sunten

reply all(2)
silver

if (count($_GET)==0 || (array_keys($_GET)[0])=='page'){

改成if (count($_GET)==0 || (array_keys($_GET))=='page'){

  • reply grateful. . . . . . . . . . .
    sunten author 2020-02-04 07:05:50
秋香姐家的小书童

There is something wrong with your syntax. If I don’t show the picture, I can’t help you. But judging from the error message, it should be something in the code. [ There is something wrong with it

  • reply <?php //If the current url does not have a get parameter or the first get parameter key is named page, it must be the home page. if (count($_GET)==0 || (array_keys($_GET))[0]=='page'){ $prefix = '?'; } else { /*** The first method: use the array_filter() function to filter out the excess parts of the GET parameters * If it is not the homepage, the page parameters must be filtered out from the URL, otherwise the page parameters will accumulate when turning pages multiple times. * First get all the key names in the current GET and form a new array. The key name of the array is the target we want to process. There must be page parameters in it. **/ // $getKeyArr = array_keys($_GET); // $filter = 'page'; //Set the get key name to be filtered out
    sunten author 2019-04-03 22:42:39
  • reply You can't upload pictures, but it would be great if you can upload pictures. The above are the first few lines of page_tpl.php, which are all installed according to the teacher's method.
    sunten author 2019-04-03 22:46:03
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!