2014级PHP程序设计
2016-2-23 14:43
请先登录。
<?php
function br(){
echo '<br/>';
}
function dump($str){
...
<?php
$password = "wujinduo123_";
$password2 = "wujinduo";
$password3 = "wujin";
function cheakPassword($n)
{
if(strlen($n)<6 ...
<?php
$str = '河北师范大学软件学院';
$search = '软件';
$newSearch = '<font color = "red">'.$search .'</font>...
<?php
/*
* 编写函数,将搜索关键词加红加粗显示
* 若搜索的关键字是“软件”,
* 以参数形式传进函数的字符串是“河北师范大学软件学院”。
*/
function keyword($str)
{
...
1.代码:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
/*
若搜索的关键字是“软件”,以参数形式传进函数的字符串是“河北师范大学软件学院...
<?php
echo '<h4>1.全局变量</h4>';
$sum=0;
function game($grade)
{
global $sum;
$sum+=$grade;
return $sum;
}
echo game(100);...
1.代码:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
/*
1、邮箱地址以参数形式传给函数。
2、必须检测邮箱地址是否合法。
3、对...
<?php
$str='河北师范大学软件学院';
$search='软件';
$newsearch="<font color='red'>$search</font>";
echo str_replace($search,$newsearch,...
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
echo '全局变量:';
echo '<br/>';
$sum = 0;
functio...
<?php
/**
*功能:创建函数库
*$var, 已定义的变量
*/
function br(){
echo '<br />';
}
function dump($var){
var_dump($var);
}
br();
dump(12...
<?php
/**
*功能:搜索关键字加红加粗
*参数$con, 搜索内容
*/
function softWare($con){
if(strpos($con,'软件')){
echo str_replace('软件', '<font color...
<?php
//全局变量
$mun = 0;
function task1(){
global $mun;
$low =$mun++...
<?php
$str = '河北师范大学软件学院';
$search = '软件';
$newSearch = '<font color="red">'.$search. '</font>';
echo(str_replace($se...
代码:
<?php
require("code.php");
$str = '河北师范大学软件学院';
$search = '软件';
$newsearch = '<font color="red">...
<?php
//全局变量
$mun = 1;
function concent1($row){
global $mun;
$low...
<?php
//全局变量
$sum = 0;
function foo($a){
global $sum;
$sum += $a;
return $sum;
}
echo foo(1);
echo '<br/>';
echo foo(1);
//静态变量...
<?php
//全局变量
$number1 = 0;
function num1(){
global $number1;
echo $number1++." ";
}
num1();num1();num1();
echo'<br/>';
//静态变量
f...
<?php
$str = '河北师范大学软件学院';
$search = '软件';
$find = '<font color="red">'.$search.'</font>';
echo str_replace($search,$find,...
<?php
//全局变量
$gamegoal = 1;
function gameGoal()
{
global $gamegoal;
$gamegoal == $gamegoal++;
echo $gamegoal;
echo "&l...
<?php
include('utf-8.php');
function checkEmail($email)
{
if (strpos($email, '@') && strpos($email, '.')) {...
$str = '河北师范大学软件学院';
$search = '软件';
$newsearch = '<font color="#FF0000">'.$search.'</font>';
//要求:软件二字加红显示;
echo str...
<?php
function br()
{
echo "<br/>";
}
function dump($var)
{
var_dump($var)
}
?>
<?php
include('utf-8.php');
$software = '河北师范大学软件学院';
$soft = '软件';
$red = '<font color = "red">'. $soft. '</...
<?php
function checkSoso($str){
if(strpos($str,'软件')!==false)
return substr($str,0,strpos($s...
<?php
//要求:软件两字加红显示
$str = '河北师范大学软件学院';
$search = '软件';
$newsearch = '<font color="red">'.$search.'</font>';
echo str_re...
function br(){
echo htmlentities("<br/>");
}
function dump($var){
var_dump($var);
}
<?php
function checkEmail($email){
if(!preg_match("/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i", $...
<?php
function regularTitle($title){
if(strlen($title)>(15*3))
return $title = substr($ti...
<?php
$password="ab123456_";
function checkPassword(&$pwd){
if(strlen($pwd) < 6 || strlen($pwd) > 12){
...
<?php
//first way
$count=0;
function sum(){
global $count;
echo $count++ ." ";
}
sum();sum();sum();
echo "<br/>";
//sec...