PHP print Yang Hui triangle:Generate any line Yang Hui triangles with PHP programming.
function Yanghui ($line)
{
echo "
for ($i =1; $i
for ($j =1; $j
}
}
{
echo "
{
Example, PHP implements the code for the Yang Hui Triangle.
error_reporting (0);
$iLine = 5;
Output Yang Hui triangle
function Yanghui ($iLine)
{
for ($i = 0; $i
{
Example, php print Yang Hui triangle.
$params =getparams (1);
$ARGV 0=trim ($params [0]);
if (!is_numeric ($argv 0))
{
Error_msg ("Params 1 must be a numbers");
}
$spaceNumber = 6;
See people always ask curl question, these two days nothing wrote a collection forum small program. It includes the simulation landing, get the page source code, regular matching results and other parts, hope to be useful to everyone.
Cache class
/*
* Cache class Caches
* Author: More rookie
* Date Created: 2006-05-05
Instance
Include ("cache.php");
$cache = new cache (30);
$cache->cachecheck ();
echo Date ("y-m-d h:i:s");
Shortcut output variables
{: function (...)} Executes the method and outputs the return value
{~function}//execution method does not output
{@var}//Output session variable
{#var}//Output cookie variable
{
A quick and simple from to search a MySQL database.Example:Mysqlsearch (' Items ', ' title tags ', isset ($get[' Q '])? $get[' q ']: ', Array (' columns ' = ' * ', ' method ' = ' OR ', ' extraSQL ' = = ' and active = ' true ' ORDER by ID DESC ');
In this program, the new class Fenye inherits the class Dbsql, so in the destructor of the new class, the destructor of the parent class is called to link the database, and the file config.inc.php defined by the global variable is included.
Read the source file of a site, and then use regular analysis of its source code, to get all the links
/**********qiushuiwuhen (2002-5-20) ***********/
if (empty ($url)) $url = "http://www.csdn.net/expert/";//Set URL
Implement a linkage menu, target: 1, click on "Anonymous group", Automatic Jump: member type "private Group", access control "group members" 2, click on "Public group", Automatic Jump: member type "real name group" such as: First, get click Radio
A simple implementation of the calendar, I do not know this code implementation of the method has no problem, no reference to predecessors, and so you understand my rotten code, and then appreciate the other people's good code, will be more helpful
Mod_rewrite is a very powerful feature of Apache that can implement pseudo-static pages.1, detect whether Apache support Mod_rewrite through the phpinfo () function provided by PHP to view the environment configuration, through Ctrl+f find "Loaded
There is the following PHP array, the contents of the array:
$list = Array (
Array (2,3,5),
Array (2,5,24),
Array (3,8,6),
Array (3,2,10),
Array (4,7,20),
Array (4,1,15),
PHP Quick Sort Small example php quick Sort Implementation methodFull code:
Set_time_limit (0);
function QuickSort ($arr) {
if (count ($arr) > 1) {//only if the array length is greater than 1
$k = $arr [0];
a non-recursive depth-first algorithm that uses a stack to implement
Define (' DS ', directory_separator);
function deep_first_list_files ($from = '. ')
{
if (!is_dir ($from)) {
return false;
}
Like the checkbox check box below:
Copy CodeExample 1, gets the value of the check box.
$loves =$_post[' loves ']; Get an array;
$loves =implode (",", $loves); The array is converted into a string;
The third of the pagination class
Class Page {
Private $total; Query the total number of records for all data
Private $page; Current page
Private $num; Shows the number of records per page
Private $pageNum; How
This class is the file operation class, implements the file establishment, writes, deletes, modifies, duplicates, moves, creates the directory, deletes the directory
/**
* This class is the file operation class, implements
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service