PHP face questions and answers, PHP questions and Answers _php tutorial

Source: Internet
Author: User

PHP face questions and answers, PHP questions and Answers


1. Write a function to perform the following functions:
The string "Open_door" is converted to "Opendoor", "make_by_id" to "Makebyid".
function Str_change ($STR) {
$str = Str_replace ("_", "", $str);
$str = Ucwords ($STR);
$str = Str_replace ("", "" ", $str);
return $str; }

2. Required to write a program that implements the following array $arr1 conversions to the arrays $ARR2:
$arr 1 = array (' fid ' = = 1, ' tid ' = + 1, ' name ' = ' Nam ') E1 '),
' 1 ' = = Array (' fid ' = = 1, ' ti ' = + 2, ' name ' = ' Name2 '),
' 2 ' = = Array (' FID ' = 1, ' Tid ' =& Gt 5, ' name ' = ' Name3 '),
' 3 ' = = Array (' FID ' = 1, ' tid ' = + 7, ' name ' = ' Name4 '),
' 4 ' = = Array (' FID ' = 3, ' tid ' = 9, ' name ' = ' Name5 ')
);
$arr 2 = array (
' 0 ' = = Array (' tid ' = + 1, ' name ' = ' Name1 '),
' 1 ' = = Array (' Tid ' = 2, ' name ' = ' Name2 '),
' 2 ' = = Array (' tid ' = 5, ' name ' = ' Name3 '),
' 3 ' = = Array (' Tid ' = 7, ' name ' = ' Name4 '),
' 1 ' = = Array (
' 0 ' = = Array (' tid ' = + 9, ' name ' = = ' name5′));

!--? php
$arr 1 = array (
' 0 ' = = Array (' FID ' = 1, ' tid ' = = ', ' name ' = ' Name1 '),
' 1 ' = ' Rray (' fid ' = 1, ' tid ' = + 2, ' name ' = ' Name2 '),
' 2 ' = = Array (' FID ' = 1, ' tid ' = + 5, ' name ' = = ' Name3 '),
' 3 ' = = Array (' fid ' = = 1, ' tid ' = + 7, ' name ' = ' Name4 '),
' 4 ' = = Array (' FID ' = 3, ' Tid ' = 9, ' name ' = ' Name5 ')
);
Function Changearraystyle ($arr) {
foreach ($arr as $key = = $value) {
$result [$value [\fid\]][]= $value;
}
return Array_values ($result);
}
$arr 2=changearraystyle ($arr 1);
echo "

 Var_dump ($arr 2); 
?

3. Please briefly describe the paradigm and application of database design. The
General 3rd paradigm is sufficient for table structure optimization, which avoids the complexity of the application and avoids the system inefficiency caused by the SQL statement being too large.
ANSWER:
The first paradigm: if each of the properties of the relational pattern R is non-decomposed, then it belongs to the first paradigm.
Second Normal form: if R belongs to the first paradigm, and all non-code attributes are fully functional dependent on the code attribute, then the second paradigm.
Third Normal form: if R belongs to the second paradigm, and none of the non-code attributes is a transfer function dependent on the candidate code, then it belongs to the third paradigm.

http://www.bkjia.com/phpjc/1048767.html www.bkjia.com true Span id= "Isbasedonurl" itemprop= "Isbasedonurl" >http://www.bkjia.com/phpjc/1048767.html techarticle php face questions and answers, PHP questions and Answers 1. Write a function, The following functions are implemented: the string "Open_door" is converted to "Opendoor", "make_by_id" to "Makebyid". function Str_ ...

  • Related Article

    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.