Home > php教程 > php手册 > body text

PHP引用返回用法示例,php用法示例

WBOY
Release: 2016-06-13 08:38:20
Original
1060 people have browsed it

PHP引用返回用法示例,php用法示例

本文实例讲述了PHP引用返回的用法。分享给大家供大家参考,具体如下:

示例1:

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

Copy after login

输出:2

示例2:

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

Copy after login

输出:3

更多关于PHP相关内容感兴趣的读者可查看本站专题:《PHP数学运算技巧总结》、《php操作office文档技巧总结(包括word,excel,access,ppt)》、《PHP数组(Array)操作技巧大全》、《php排序算法总结》、《PHP常用遍历算法与技巧总结》、《PHP数据结构与算法教程》、《php程序设计算法总结》、《php正则表达式用法总结》、《PHP运算与运算符用法总结》、《php字符串(string)用法总结》及《php常见数据库操作技巧汇总》

希望本文所述对大家PHP程序设计有所帮助。

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!