PHP Basic Knowledge Summary (V) PHP face questions

Source: Internet
Author: User
Tags php template

1. Ajax Cross-Domain

JSON: Data Interchange Format, {"Name": "Wangtianle"}

JSONP: Unofficial cross-domain data exchange protocol, can be dynamically added <script/> tags to invoke the server-provided JS script

JSONP Example:

(1) front page test.html

<!doctype html>

(2) test.html referenced script ajax.js

$.ajax ({    "post",    "ajax.php",    "Jsonp",    "callback",// the parameter name passed to the request handler or page to obtain the name of the JSONP callback function (default: Callback)    jsonpcallback: "Success_jsonpcallback",/ / Custom JSONP callback function name, the default is jquery automatically generated random function name function    (JSON) {        alert (' Success, JSON return value= ' + json    },    error:function() {        alert (' (fail ');    }});

(3) Back-end ajax.php:

<?  $data = "..."; $callback $_get [' Callback ']; Var_dump ($callback); Echo $callback. ' ('. Json_encode ($data). ') ' ; Exit  ?>

2, PHP template engine: Separate PHP and HTML, there are smarty components

3, Forum Unlimited classification of the implementation principle:

Design a parent field in a table in db to

4, GD library: PHP Processing Image Expansion Library

5, Mb_strlen ($STR); Calculate the length of a string

Mb_substr ($str, $i, ten, $encoding); Gets $str, starting with $i, a partial string of length 10

6.

PHP Basic Knowledge Summary (V) PHP face questions

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.