Home > Backend Development > PHP Tutorial > PHP reference return usage example, php usage example_PHP tutorial

PHP reference return usage example, php usage example_PHP tutorial

WBOY
Release: 2016-07-12 08:50:55
Original
941 people have browsed it

PHP reference return usage examples, php usage examples

The examples in this article describe the usage of PHP reference returns. Share it with everyone for your reference, the details are as follows:

Example 1:

<&#63;php
$a = 1;
function b(&$c)
{
  $c++;
  return $c;
}
$d=b($a);
$d++;
echo($a);
&#63;> 

Copy after login

Output: 2

Example 2:

<&#63;php
$a = 1;
function &b(&$c)
{
  $c++;
  return $c;
}
$d=&b($a);
$d++;
echo($a);
&#63;>

Copy after login

Output: 3

Readers who are interested in more PHP-related content can check out the special topics on this site: "Summary of PHP mathematical operation skills", "Summary of PHP operating office document skills (including word, excel, access, ppt)", "PHP array ( Array) operating skills collection", "php sorting algorithm summary", "php common traversal algorithms and techniques summary", "php data structure and algorithm tutorial", "php programming algorithm summary", "php regular expression usage summary", "Summary of PHP operations and operator usage", "Summary of PHP string usage" and "Summary of common PHP database operation skills"

I hope this article will be helpful to everyone in PHP programming.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1133057.htmlTechArticlePHP reference return usage example, php usage example This article describes the usage of PHP reference return. Share it with everyone for your reference, as follows: Example 1: php$a = 1;function b( retu...
Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template