设为首页
收藏本站
切换到窄版
登录
立即注册
找回密码
搜索
搜索
本版
帖子
用户
快捷导航
论坛
BBS
C语言
C++
NET
JAVA
PHP
易语言
数据库
IE盒子
»
论坛
›
IE盒子
›
PHP
›
面向菜鸟教程学习php
返回列表
发帖
查看:
118
|
回复:
0
面向菜鸟教程学习php
[复制链接]
南方刺
南方刺
当前离线
积分
9
2
主题
4
帖子
9
积分
新手上路
新手上路, 积分 9, 距离下一级还需 41 积分
新手上路, 积分 9, 距离下一级还需 41 积分
积分
9
发消息
发表于 2023-1-5 19:18:33
|
显示全部楼层
|
阅读模式
<?php$t=date(&#34;H&#34;);if ($t<&#34;20&#34;){ echo &#34;Have a good day!&#34;; echo $t; echo &#34;Hello world &#34;; echo &#34;我要学 PHP!<br>&#34;;} ?>
首先,已知<br>是空格的意思,echo输出语句只能在方法里,当然java中System也是如此/
date(&#34;H&#34;); 表示时间,现在是16点,所以$t是 16
php中$t=date()函数参数意义及时间更改
PHP date() 函数 | 菜鸟教程 (runoob.com)
<br>在方法中 和方法外用法不一样的
方法里借助echo “<br>”才能是空格,<?php ?>外面直接<br>
接下来的任务是熟悉书本149页的内容。以及数组的内容。dreamweaver的表单
array_rand 函数是啥意思
其中 => 表示数组键名与元素的连接符。简单来说就是使用=>符号来分隔键和值,左侧表示键,右侧表示值。
表单建立,单选框,复选框,插入图片
07.[Dreamweaver]第7章 表单[上]_哔哩哔哩_bilibili
08.[Dreamweaver]第7章 表单[下]_哔哩哔哩_bilibili
php投票问题
<form id=&#34;form1&#34; name=&#34;form1&#34; method=&#34;post&#34; action=&#34;&#34;>
<table width=&#34;59%&#34; border=&#34;1&#34;>
<tr>
<td width=&#34;34%&#34;><input type=&#34;radio&#34; name=&#34;radio&#34; id=&#34;radio&#34; value=&#34;中国&#34; /> <label for=&#34;radio&#34;></label></td>
<td width=&#34;35%&#34;>中国</td>
<td width=&#34;31%&#34;>&nbsp; </td>
</tr>
<tr>
<td height=&#34;81&#34;><input type=&#34;radio&#34; name=&#34;radio&#34; id=&#34;radio2&#34; value=&#34;日本&#34; /></td>
<td>日本</td>
<td>&nbsp;</td>
</tr>
<tr>
<td height=&#34;127&#34;><input type=&#34;submit&#34; name=&#34;button&#34; id=&#34;button&#34; value=&#34;提交&#34; /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</form>
<?php
$file =fopen(&#34;./test.txt&#34;,&#34;r&#34;);
//获取file文件中的一行字符
$b = fgets($file);
//将文件中的字符0:0打散成数组,用$c接收
$c =explode(&#34;:&#34;,$b);
fclose($file);
if($_POST[&#39;button&#39;]==&#34;提交&#34;)
{
$a = $_POST[&#39;radio&#39;];
if($a ==&#34;中国&#34;)$c[0]++;
if($a ==&#34;日本&#34;)$c[1]++;
echo &#34;目前中国 的投票 数&#34;.$c[0];
echo &#34;目前日本 的投票 数&#34;.$c[1].&#34; &#34;;
//将数组缝合成字符串
$d = implode(&#34;:&#34;,$c);
echo $d;
$file2=fopen(&#34;./test.txt&#34;,&#34;w&#34;);
fwrite($file2,$d);
fclose($file2);
}
?>
点击中国
php“天龙八部”问题,需要熟练掌握
小p打开phpmysql,需要将原来的mysql关闭。问题是现在在sel 界面,mysql查找不到想查的信息
mysql 增删改查语句
回复
使用道具
举报
返回列表
发帖
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
本版积分规则
发表回复
回帖后跳转到最后一页
浏览过的版块
C语言
NET
快速回复
返回顶部
返回列表