Questions about the PHP interface "Novice rookie seeking guidance"

Source: Internet
Author: User
Tags what parameter
Leader let's write an interface
PHP provides data
I am a circle, not I do not study, I have been online search 1 days, really can not find, it may be my concept is wrong, but the exact words are said.
Want to ask the Elders to guide the maze, the best specific point, the idea to say through the line, do not need code case.
(Of course, there is no specific task, it should be a project, used to do a small small module, such as search function, get the characters in the URL to determine whether to display content, etc.)


Reply to discussion (solution)

Leader let's write an interface
PHP provides data
I am a circle, not I do not study, I have been online search 1 days, really can not find, it may be my concept is wrong, but the exact words are said.
Want to ask the Elders to guide the maze, the best specific point, the idea to say through the line, do not need code case.
(Of course, there is no specific task, it should be a project, used to do a small small module, such as search function, get the characters in the URL to determine whether to display content, etc.)


I'm not clear, I don't understand what he's talking about, interface I know, but I don't understand. PHP provides data, how to provide data with interfaces, is it get then return value?? Or what?

Provide JSON-formatted data on the line ...

You understand the right, is to get, and then return the value. The form of the value depends on the expected format of the other person.

You understand the right, is to get, and then return the value. The form of the value depends on the expected format of the other person.


For example, does he expect to be available in JSON format?
Is there any other storage in addition to JSON?
"The form of a value depends on the expected format of the other person." This sentence of yours I do not quite understand, please the old master a little nudge

It means that the other person wants to format the data, and you give it back what format data.

Interface is, get what parameter, return what result

such as test.php

Request
Type
Name

Response
Success True or False

$type = isset ($_get[' type ')? $_get[' type ': '; $name = isset ($_get[' name '])? $_get[' name ']: '; $ret = array (); if ($type ==1 && $name = = ' Fdipzone ') {    $ret [' success '] = true;} else{    $ret [' success '] = false;} echo Json_encode ($ret);

Interface is, get what parameter, return what result

such as test.php

Request
Type
Name

Response
Success True or False

$type = isset ($_get[' type ')? $_get[' type ': '; $name = isset ($_get[' name '])? $_get[' name ']: '; $ret = array (); if ($type ==1 && $name = = ' Fdipzone ') {    $ret [' success '] = true;} else{    $ret [' success '] = false;} echo Json_encode ($ret);


I understand that, thank you.

This provides the data interface good understanding, you can understand into a special page, the normal page is a variety of tags, interface because to facilitate the analysis and reading of the program, the returned data is some of the program understandable data such as Xml/json and some data format known parser.

  • 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.