Questions about the PHP interface "novice Beginner seeking guidance"

Source: Internet
Author: User
Questions about the PHP interface "Novice rookie seeking guidance"
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.)
------to solve the idea----------------------
Provide JSON-formatted data on the line ...
------to solve the idea----------------------
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.
------to solve the idea----------------------
It means that the other person wants to format the data, and you give it back what format data.
------to solve the idea----------------------
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);
  • 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.