Home Backend Development PHP Tutorial PHP provides an interface for the app to carry parameters and return

PHP provides an interface for the app to carry parameters and return

Jul 29, 2016 am 09:00 AM
data encode quot string

<?php
function say(){


$test= $_GET["a"];

if (empty($test)) {
$data["result"]=(string) 2; echo json_encode($data);exit;

}else{
$data["result"]=(string) 1;echo json_encode($data);exit;

}

}
say();
? >

The above introduces the interface provided by PHP for the app to carry parameters and return them, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Convert basic data types to strings using Java's String.valueOf() function Convert basic data types to strings using Java's String.valueOf() function Jul 24, 2023 pm 07:55 PM

Convert basic data types to strings using Java's String.valueOf() function

How to convert char array to string How to convert char array to string Jun 09, 2023 am 10:04 AM

How to convert char array to string

Use Java's String.replace() function to replace characters (strings) in a string Use Java's String.replace() function to replace characters (strings) in a string Jul 25, 2023 pm 05:16 PM

Use Java's String.replace() function to replace characters (strings) in a string

2w words detailed explanation String, yyds 2w words detailed explanation String, yyds Aug 24, 2023 pm 03:56 PM

2w words detailed explanation String, yyds

How to use the split method in Java String How to use the split method in Java String May 02, 2023 am 09:37 AM

How to use the split method in Java String

Use java's String.length() function to get the length of a string Use java's String.length() function to get the length of a string Jul 25, 2023 am 09:09 AM

Use java's String.length() function to get the length of a string

How to use java's String class How to use java's String class Apr 19, 2023 pm 01:19 PM

How to use java's String class

Convert a string to lowercase using java's String.toLowerCase() function Convert a string to lowercase using java's String.toLowerCase() function Jul 24, 2023 pm 11:52 PM

Convert a string to lowercase using java's String.toLowerCase() function

See all articles