Introduced
notepad++ is an alternative Notepad editor for open source code. It runs in the MS Windows environment and supports a variety of programming languages. You can browse http://notepad-plus.sourceforge.net/for more information.
Xdebug is an extension of PHP that provides a variety of functions for debugging, tracking, and checking PHP scripts. You can browse http://xdebug.org for more information.
Download
notepad++ Download Address: Http://nchc.dl.sourceforge.net/sourceforge/notepad-plus/npp.4.7.5.Installer.exe
notepad++ plugin DBGP Plugin:http://nchc.dl.sourceforge.net/sourceforge/npp-plugins/dbgpplugin_0_7b_fix_dll.zip
Xdebug:http://xdebug.org/link.php?url=xdebug202-52-win
* Xdebug version needs to match the environment using the PHP version, where the links provided for PHP 5.2.1-5.2.7 use Xdebug.
Xdebug Helper for firefox:https://addons.mozilla.org/zh-cn/firefox/addon/3960
Installation
The installation of notepad++ is as simple as most Windows software. Simply follow the on-screen prompts and click "Next" and the final "finish" can be installed successfully.
In order for notepad++ and Xdebug to work together, DBGP plugin need to be installed. After downloading, simply unzip to the plugins directory in the notepad++ installation directory, such as: C:Program Filesnotepad++plugins.
Xdebug installation Please refer to: Http://www.mikespook.com/index.php/archives/34. What needs to be explained is that if the XCache is installed at the same time must first load XCache, then load Xdebug. Otherwise it will cause PHP to run abnormally.
Use
First, you will write two functions that use recursive methods and use loops to compute the factorial of 100, as follows:
<?php
Function f1($x)
// loop calculates the factorial of $x
{
For($i = $x - 1; $i > 1; $i–)
{
$x *= $i;
}
Return $x;
}
Function f2($x)
// Recursively calculate the factorial of $x
{
If($x == 1)
{
Return $x;
}
Else
{
$y = $x - 1;
Return $x * f2($y);
}
}
Echo ‘f1: ‘ . f1(10);
Echo ‘<br />’;
Echo ‘f2: ‘ . f2(10);