php 代替 echo 方法, 或者php的 替换语法使用方法.
修改php.ini文件.
如下.
1. short_open_tag = Off
如果改成On
我们可以在php中
<?= $variable?>来代替 <?php echo $variable ?>
2. asp_tags = Off
如果改成On
同样可以在php中
<%= $variable %> 来替代<?php echo $variable ?>
怎么样. 方便吧????
继续研究~~~~~~!!!!~~!~!~!~!~!~!~!
相关文档:
我们知道用powerdesigner导出的sql文件后缀为'.sql';用phpmyadmin很容易导入MysQL数据库,但是用PHP怎么导入数据库呢?
我用powerdesigner设计一个数据库后导出sql文件(一个投票系统)为'vote.sql';
文件内容为(一些sql语句和注释):
/*======================= ......
<p>04级新生名单</p>
<table border="1" width="80%" cellpadding="0">
<tr>
<td width="10%" align="center">Id</td>
<td width="20%" align="center">Name</td>
<td width="10%" align="center">Age</td>
<td width="10%" align="cent ......
$pagesize=10; //设置每一页显示的记录数
$c("localhost","root",""); //连接数据库
$rs=mysql_query("select count(*) from tb_product",$conn); //取得记录总数$rs
$myrow = mysql_fetch_array($rs);
$numrows=$myrow[0];
Ɍ ......
找了很多这样的函数,还是觉的这个最好了
$a = 'aadfdsf夺顶替一枯基22245顶替sdffh压下';
/**
* 截取utf-8字符
* @param string $string
* @param int$length
*
* return string
*/
function cutstr($string, $length) {
preg_match_all("/./u", $string, $info);
$i = 0;
$str = '';
foreach($inf ......