Home  >  Article  >  Backend Development  >  PHP引用返回用法示例,php用法示例_PHP教程

PHP引用返回用法示例,php用法示例_PHP教程

WBOY
WBOYOriginal
2016-07-12 08:50:55894browse

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

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

示例1:

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

输出:2

示例2:

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

输出:3

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

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

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1133057.htmlTechArticlePHP引用返回用法示例,php用法示例 本文实例讲述了PHP引用返回的用法。分享给大家供大家参考,具体如下: 示例1: php$a = 1;function b( retu...
Statement:
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