很多站长朋友们都不太清楚php知识点ppt,今天小编就来给大家整理php知识点ppt,希望对各位有所帮助,具体内容如下:
本文目录一览: 1、 php知识框架总结 2、 php要学哪些内容? 3、 PHP如何读取PPT? php知识框架总结php知识框架总结
篇一:php基础知识点总结
PHP语言基础简单整理
1.开始结束标记的格式只有在没有判断语句时才能使用。
对表单传递的变量进行编码和解码:PHP中实现对查询字符串进行URL编码可以通过函数urlencode()实现,该函数的使用格式如下:string urlencode(string str);对URL编码后的查询字符串进行解码,可以通过urldecode()函数实现,该函数的使用格式如下:string urldecode(string str);
15.PHP连接数据库:
步骤: 一、建立连接------mssql_connect(server,uid,pwd);
二、指定database-------mssql_select_db(databasename);
三、执行sql------mssql_query($sql,$link);
四、处理记录集-------资源类型数据,格式:bof---数据---eof
五、以特定格式读取数据-----mssql_fetch_array()....
六、释放相关资源、关闭连接------mssql_free_result($result);mssql_close();
16.数组:php的数组由键值和value值组成
定义:$array = array("键值"=>"value","键值"=>"value","键值"=>"value");如果不给键值赋值,默认从0开始的int值
相关函数:(1)in_array("值",数组名); 返回bool型-----查看数组中是否存在某value值
(2)array_key_exists("key值",数组名); 返回bool型-----查看数组中是否存在某键值
(3)array_keys(数组名);---将数组键值返回出来形成一个新数组,此键值作为新数组的value值
(4)array_values(数组名);---将数组value值返回出来形成一个新数组,此值作为新数组的value值
(5)key(数组名);----返回当前指针指向的元素key值
(6)current(数组名);----返回当前指针指向的元素value值
(7)next(数组名);----挪动当前数组指针到下一步
(8)reset(数组名);----恢复数组指针,指向第0个元素
(9)end(数组名);----将指针挪向最后一个元素
(10)prev(数组名);----将指针向前挪动一位
(11)foreach(数组名 as $key=>$value)
{
$key是键值,$value是value值,实现数组遍历
}
(12)each(数组名);----将当前数组元素依次取出(自动挪动指针)并放到一个新的数组中
(13)array_shift(数组名);----返回数组中第一个元素值
(14)array_pop(数组名);----返回数组最后一个元素值
(15)array_push(数组名,value);----向数组中追加元素
(16)array_unshift(数组名,value);----在数组最前面添加元素
(17)array_pad(数组名,数组长度,value);----向数组中追加多个元素,对数组副本操作,不改变原数组,返回一个新数组
(18)count();----返回个数
(19)array_unique(数组名);----去掉数组中重复部分,操作数组副本,不改变原数组,返回新数组
(20)sort(数组名);----从小到大升序排列数组value值,一般针对int型value值,返回bool型,成功返回true
(21)rsort(数组名);----从大到小,逆序排列数组value值
(22)array_combine(数组1,数组2);----将数组1的value值作为key,数组2的value值作为value值,形成一个新数组
(23)array_merge(数组1,数组2,数组3...);----合并多个数组,将多个数组value值依次合并,合为一个数组
(24)array_slice(数组名,int,int);----从目标数组截取元素,形成一个新数组。开始位置为第二个参数,结束位置为第三个参数。若第三个参数不写,则默认是截取到最后。
(25)array_splice();----用法同array_slice();但是其截取部分从原数组中删除
(26)explode("字符依据",目标字符串);----将字符串按照一定的依据拆分成数组
(27)implode("字符依据",目标数组);----将数组元素按照依据组合成一个字符串
(28)range(mixed low,mixed high[number step]);----生成数组,例:range(1,100,8);---即从1到100,每8位取一个数,组成一个数组
(29)shuffle(数组名);----用于将数组进行随机排序
(30)array_sum(数组名);----对数值型数组元素值进行求和
(31)array_chunk(数组名,int);----分割目标数组,返回一个新数组,其中数组的每个元素都是一个一维数组,int参数为分割成的一维数组的长度
17.Cookie和会话控制:
Cookie是在HTTP协议下,服务器或脚本可以维护客户工作站上信息的一种方式。Cookie是由Web服务器保存在客户机上的小文本文件,它可以包含有关用户的信息。无论何时用户链接到服务器,Web站点都可以访问Cookie信息。
存在server端的是session,存在client端的是cookie,它们用来存储全局变量。 设定Cookie值:setcookie("名","值");
通过Cookie数组取值:$_cookie["名"];
设置生成期:setcookie("名","值",time()+1800);生成期为当前时间加1800秒之后。
删除cookie: setcookie("名","",time()-3600);中间值设置为空,并将当前时间减去3600秒。 Cookie数组:setcookie("名[key]","值"); 使用foreach读取。
在PHP中可以通过$_COOKIE预定义变量访问Cookie的值。如果设置了php.ini中的register_long_arrays,那么就能够应用$_COOKIE和$HTTP_COOKIE_VARS;如果在php.ini中还设置了register_globals,那么就可以在PHP中作为全局变量使用各个Cookie值。但是,更改php.ini中的两个文件设置,容易对PHP的安全构成威胁,不推荐使用该方法,建议使用更新的$_COOKIE。
会话ID的传送
会话ID的传送有两种方式,一种是Cookie方式,另一种是URL方式。
Cookie传送方式:
这是最简单的会话方式,但是有些客户可能限制使用Cookie,如果客户限制使用Cookie的条件下,仍要继续工作,那就要通过其他方式来实现了。
URL传送方式:
在该方式中,URL本身用来传送会话,会话标志被简单地附加到URL的尾部,或者作为窗体中的一个变量来传递。例:
php要学哪些内容?需要了解的知识包括HTML、CSS、JavaScript,不需要深入地学习,有个概念性的理解即可。
知识学习有三个阶段:
PHP入门段
可以在网上找到各类PHP热门视频,基本上这些视频里面都会讲到如何使用编辑,配置环境等一系列基础教程。能撸出一个个人站点/ 企业小站 就可以进入下一步了这样可以先对编程有一个初步的认识,如果没有任何电脑基础不推荐直接看书。
进步段
这时候需要PHP手册了,了解常用函数。学习MySQL( 数据库 ),了解PHP各大框架 --thinkPHP,Yii,Laravel等, 然后选一款框架尝试搭建一blog,实现常规登录、注册、文章发布和修改。
提高段
这一阶段的知识点主要包括:了解Linux ,在Linux下搭建 PHP环境(这时候要脱离 xamp,wamp等之流了);知道使用版本控制:git svn。
PHP如何读取PPT?<?php header("content-type:text/html;charset=utf-8");//字体设置防止乱码 error_reporting(E_ALL); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . 'Classes/'); /** PHPPowerPoint */ include 'PHPPowerPoint.php'; /** PHPPowerPoint_IOFactory */ include 'PHPPowerPoint/IOFactory.php'; // Create new PHPPowerPoint object //echo date('H:i:s') . " Create new PHPPowerPoint object\n"; $objPHPPowerPoint = new PHPPowerPoint(); $objPHPPowerPoint->getProperties()->setCreator("Maarten Balliauw"); $objPHPPowerPoint->getProperties()->setLastModifiedBy("Maarten Balliauw"); $objPHPPowerPoint->getProperties()->setTitle("Office 2007 PPTX Test Document"); $objPHPPowerPoint->getProperties()->setSubject("Office 2007 PPTX Test Document"); $objPHPPowerPoint->getProperties()->setDescription("Test document for Office 2007 PPTX, generated using PHP classes."); $objPHPPowerPoint->getProperties()->setKeywords("office 2007 openxml php"); $objPHPPowerPoint->getProperties()->setCategory("Test result file"); // Remove first slide //echo date('H:i:s') . " Remove first slide\n"; $objPHPPowerPoint->removeSlideByIndex(0); // Create templated slide //echo date('H:i:s') . " Create templated slide\n"; /*$currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function // Create a shape (text) echo date('H:i:s') . " Create a shape (rich text)\n"; $shape = $currentSlide->createRichTextShape(); $shape->setHeight(200); $shape->setWidth(600); $shape->setOffsetX(10); $shape->setOffsetY(400); $shape->getAlignment()->setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT ); $textRun = $shape->createTextRun('Introduction to'); $textRun->getFont()->setBold(true); $textRun->getFont()->setSize(28); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); $shape->createBreak(); $textRun = $shape->createTextRun('PHPPowerPoint'); $textRun->getFont()->setBold(true); $textRun->getFont()->setSize(60); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); // Create templated slide echo date('H:i:s') . " Create templated slide\n"; $currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function // Create a shape (text) echo date('H:i:s') . " Create a shape (rich text)\n"; $shape = $currentSlide->createRichTextShape(); $shape->setHeight(100); $shape->setWidth(930); $shape->setOffsetX(10); $shape->setOffsetY(10); $shape->getAlignment()->setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT ); $textRun = $shape->createTextRun('What is PHPPowerPoint?'); $textRun->getFont()->setBold(true); $textRun->getFont()->setSize(48); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); // Create a shape (text) echo date('H:i:s') . " Create a shape (rich text)\n"; $shape = $currentSlide->createRichTextShape(); $shape->setHeight(600); $shape->setWidth(930); $shape->setOffsetX(10); $shape->setOffsetY(100); $shape->getAlignment()->setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT ); $textRun = $shape->createTextRun('- Generate slide decks'); $textRun->getFont()->setSize(36); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); $shape->createBreak(); $textRun = $shape->createTextRun(' - Represent business data'); $textRun->getFont()->setSize(28); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); $shape->createBreak(); $textRun = $shape->createTextRun(' - Show a family slide show'); $textRun->getFont()->setSize(28); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); $shape->createBreak(); $textRun = $shape->createTextRun(' - ...'); $textRun->getFont()->setSize(28); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); $shape->createBreak(); $textRun = $shape->createTextRun('- Export these to different formats'); $textRun->getFont()->setSize(36); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); $shape->createBreak(); $textRun = $shape->createTextRun(' - PowerPoint 2007'); $textRun->getFont()->setSize(28); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); $shape->createBreak(); $textRun = $shape->createTextRun(' - Serialized'); $textRun->getFont()->setSize(28); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); $shape->createBreak(); $textRun = $shape->createTextRun(' - ... (more to come) ...'); $textRun->getFont()->setSize(28); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); // Create templated slide echo date('H:i:s') . " Create templated slide\n"; $currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function // Create a shape (text) echo date('H:i:s') . " Create a shape (rich text)\n"; $shape = $currentSlide->createRichTextShape(); $shape->setHeight(100); $shape->setWidth(930); $shape->setOffsetX(10); $shape->setOffsetY(10); $shape->getAlignment()->setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT ); $textRun = $shape->createTextRun('Need more info?'); $textRun->getFont()->setBold(true); $textRun->getFont()->setSize(48); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); // Create a shape (text) echo date('H:i:s') . " Create a shape (rich text)\n"; $shape = $currentSlide->createRichTextShape(); $shape->setHeight(600); $shape->setWidth(930); $shape->setOffsetX(10); $shape->setOffsetY(100); $shape->getAlignment()->setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT ); $textRun = $shape->createTextRun('Check the project site on CodePlex:'); $textRun->getFont()->setSize(36); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); $shape->createBreak(); $textRun = $shape->createTextRun(' ); $textRun->getFont()->setSize(36); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) ); // Create templated slide echo date('H:i:s') . " Create templated slide\n";*/ //test //从数据库调取数据进行for循环 $row=array('titlepic'=>array('./images/love.gif','./images/love1.gif','./images/love2.gif','./images/love3.gif'),'xsprice'=>array("55","33","22","333"),'cjid'=>array('100','222','333','3333'),'lpid'=>array('111','222','333','444'),'price'=>array('111','433','243','3245')); for($i=0;$i<4;$i++) { $currentSlide = createTemplatedSlide1($objPHPPowerPoint,$row["titlepic"][$i]); // local function // Create a shape (text) //echo date('H:i:s') . " Create a shape (rich text)\n"; $shape = $currentSlide->createRichTextShape(); $shape->setHeight(100); $shape->setWidth(930); //调整字体的高度宽度 $shape->setOffsetX(20); $shape->setOffsetY(400); //$shape->getAlignment()->setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT ); $row["price"]=iconv("utf-8","gb2312",$row["price"][$i]); $textRun = $shape->createTextRun('礼品网价格:'.$row["xsprice"][$i]); $textRun->getFont()->setBold(true); $textRun->getFont()->setSize(48); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( '#000000' ) ); $shape = $currentSlide->createRichTextShape(); $shape->setHeight(600); $shape->setWidth(930); $shape->setOffsetX(20); $shape->setOffsetY(500); $shape->getAlignment()->setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT ); //添加多行内容从这开始 $textRun = $shape->createTextRun('公司编号: '.$row["cjid"][$i]); $textRun->getFont()->setSize(36); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( '#000000' ) ); $shape->createBreak(); $textRun = $shape->createTextRun('礼品网编号: '.$row["lpid"][$i]); $textRun->getFont()->setSize(36); $textRun->getFont()->setColor( new PHPPowerPoint_Style_Color( '#000000' ) ); //test // Save PowerPoint 2007 file } //echo date('H:i:s') . " Write to PowerPoint2007 format\n"; $objWriter = PHPPowerPoint_IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007'); $objWriter->save(str_replace('.php', '.pptx',__FILE__)); header("Content-type:application/vnd.ms-powerpoint;"); header("location:02presentation.pptx"); // Echo memory peak usage //echo date('H:i:s') . " Peak memory usage: " . (memory_get_peak_usage(true) / 1024 / 1024) . " MB\r\n"; // Echo done //echo date('H:i:s') . " Done writing file.\r\n"; /** * Creates a templated slide * * @param PHPPowerPoint $objPHPPowerPoint * @return PHPPowerPoint_Slide */ function createTemplatedSlide1(PHPPowerPoint $objPHPPowerPoint,$cs1) { // Create slide $slide = $objPHPPowerPoint->createSlide(); // Add background image $shape = $slide->createDrawingShape(); $shape->setName('Background'); $shape->setDescription('Background'); $shape->setPath('./images/realdolmen_bg.jpg'); $shape->setWidth(950); $shape->setHeight(720); $shape->setOffsetX(0); $shape->setOffsetY(0); // Add logo $shape = $slide->createDrawingShape(); $shape->setName('PHPPowerPoint logo'); $shape->setDescription('PHPPowerPoint logo'); $shape->setPath($cs1); $shape->setHeight(120); $shape->setOffsetX(10); $shape->setOffsetY(10); // Return slide return $slide; }
关于php知识点ppt的介绍到此就结束了,不知道本篇文章是否对您有帮助呢?如果你还想了解更多此类信息,记得收藏关注本站,我们会不定期更新哦。