You can take a look at several php pen questions from night travelers.
I. basic questions
1. write the output results of the following program
The code is as follows:
$ Str1 = null;$ Str2 = false;Echo $ str1 = $ str2? 'Equality ': 'Unequal ';$
The following small series will introduce four simple methods (with examples) for parsing xml in php ). I think this is quite good. now I will share it with you and give you a reference. Let's take a look at the XML processing that we often
When you see the error prompt
Syntax error, unexpected t_encapsed_and_whitespace, expecting t_string or t_variable or t_num_string
This hint is an issue that prompts for variable usage.
And what I came up with was that the array was used in the
I installed magento2 on ubuntu14. when I access localhost on the webpage, the apache prompt ItWork is displayed !, However, when localhostmagento2 prompts HTTPERROR500, I installed it with the following command: {code ...} after the error, I checked
//--------------------
Basic Data Structures
//--------------------
Binary lookup (Find an element in an array)
Functionbin_sch ($array, $low, $high, $k) {
if ($low $mid =intval (($low + $high)/2);
if ($array [$mid]== $k) {
Return$mid;
}elseif ($k
I installed Magento2 on UBUNTU14, Web Access http://localhost/can show the Apache hint it work! , but http://localhost/magento2/tip http ERROR 500
I installed it by using the following command:
Apt-get updateapt-get install git wgetwget-o/usr/local/
This article will share with you a function that uses the special characters in Json in php of the old version. although it is not very practical, record it, if you have any need, refer. Create an API for an App, extract data from MySQL on the
$users = Array ("qdv.cn", "haotu.net", "sharejs.com", "google.com");
Print count ($users)-1;
Copy CodeExample 2,php gets the usage of the array's length function count.Example 2,count function to get the length of an array
: This article mainly introduces PHP to implement various classic algorithms. For more information about PHP tutorials, see.
//--------------------
// Basic data structure algorithm
//--------------------
// Binary search (find an element in the
PHP code for parameter filtering
** @ Param string $ string the string to be converted * @ return string */static public function nl2br ($ string) {return nl2br ($ string);}/*** setConvert to \ n ** @ param string $ string to be converted * @
PHP reads XML php reads xml
1. php code
Books. xml file:
Jack Herrington
PHP Hacks
O 'Reilly
Jack Herrington
Podcasting Hacks
O 'Reilly
1. DOMDocument method
Load ('books. XML'); $ books = $
No code, no idea, you can.
For example
$earth = Array (
'asia'=>array( 'china'=>array( 'beijing', 'shanghai', 'tianjin', 'hangzhou' ), 'japan'=>array( 'tokyo', 'hokkaido', 'nagasaki'
1,c program parameters (write c--argc,argv[with parameters), main program with parametersProgram Function Description:Copy the file identified by the previous file name in the command line argument to the file identified by the latter file name, if
The original code is as follows:
$pattern = Array ( '//
|\n]*?({.+?})[^ ',//replace Smarty comment '/
|{|\n]*?--> /', //Replace the non-wrapped HTML comment '/(href=["|\ ']) \.\. \/(.*?
$a =2344;//The main string, fixed value.
The following variables are changeable
If $b=12;//determines whether a $ A string contains 1 and 2, the result is false
If $b=22;//determines whether a $ A string contains two 2, the result is only one 2,
Slot Spit, recently in a book called "Code Concise Way", the book says How to make your code easier to read and benefit. Interested friends can have a look.
Phper rarely use exceptions, and it's not uncommon for a company to be a real bull. In more
This is a php interview question for a real IT company recruiting php programmers. all the questions are about algorithms. To be honest, these are simple basic algorithms! The following php interview questions are all provided with answers. please
Array: creates a new array. Array_walk: allows a user-defined function to process every element in the array. Arsort: sorts the array values from large to small. Asort: sorts the array values from small to large. Count: calculates the elements in a
A function of PHP escaping special characters in JSON
Make an API for an App, pull the data from the server-side MySQL, and then generate the JSON. There is a field in the data called content, which holds the content of the article, contains a lot
ArrayWhat is an array?An array in a computer refers to a data type that is organized in a certain order by a number of variables of the same type.The popular point is that the array is one of the variables, in terms of the current term is a variable
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.