本文目录一览:
- 1、powerpoint2010属于图文处理软件
- 2、php怎么读取ppt文字内容并在浏览器中显示出来?
- 3、php视频教程,php学习如何入门,如何精通?
- 4、PHP如何读取PPT?
- 5、如何学习php
- 6、PHP闭包函数传参及使用外部变量的方法
powerpoint2010属于图文处理软件
不属于。powerpoint2010是微软公司的演示文稿软件,Microsoftoffice2010中的一个办公组件,用来制作和放映演示文稿(俗称PPT文件)。powerpoint2010新增音频和可视化功能,可以帮助用户讲述一个简洁的电影故事。php入门到就业线上直播课:进入学习PowerPoint2010是Microsoftoffice2010中的一个办公组件,一个演示文稿软件。
php怎么读取ppt文字内容并在浏览器中显示出来?
具体代码麻烦我就不写了,可以提供给你一个思路:
首先要求服务器上安装wps或者microsoft powerpoint软件,然后通过api接口来访问并读取ppt,最后将其发送到页面。
当然你不能每次等别人访问的时候再去读取,不然太慢。。这个办法比较简便,如果你想直接读取,则需要详细了解ppt文件的格式。
php视频教程,php学习如何入门,如何精通?
《PHP基础视频》百度网盘资源免费下载
链接:
提取码:cykj
PHP基础视频|day7_视频|day6_视频|day5_视频|day4_视频|day3_视频|day2-视频|day1 视频|学习求助或资源索取,请加Q2885620350.txt|对应笔记 PPT 模板 源码下载地址.zip|PHP学习路线图更新说明.txt|2017黑马PHP珍贵学习资源.zip|9-将PHP作为模块提供给Apache加载.wmv|8-安装PHP.wmv|7-http指令.wmv -php入门ppt
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;$i4;$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
如何学习php
PHP相对于其他语言,比较简单,相对好上手,比较适合零基础的人学习,自学的话对自己的自律性要求很高,我之前就在领元学校学习的,所以如果可以的话我建议去学习班里学习,后期边开发边学习,问题和错误一个个解决过去,不断的积累经验。-php入门ppt
PHP闭包函数传参及使用外部变量的方法
本文实例讲述了PHP闭包函数传参及使用外部变量的方法。分享给大家供大家参考,具体如下:
在Laravel控制器写两个方法,一个是在内部创建一个闭包函数,一个是执行传过来的闭包函数,测试闭包的写法,use使用外部变量,及闭包函数的传参。如下:
//测试闭包传参及use使用外部变量
public
function
testClosure($t1,
$t2)
{
$closure
=
function
($param1,
$param2)
use
($t1,
$t2)
{
echo
$param1.$param2.$t1.$t2;
};
$this-execClosure('test.closure',
$closure);
}
//执行闭包函数
protected
function
execClosure($name,
Closure
$closure)
{
echo
'Closure
func
name:'.$name;
echo
'br';
$closure('p1',
'p2');
}
在routes.php添加路由:
复制代码
代码如下:Route::get('/test/closure/{t1}/{t2}',['uses'='TestController@testClosure']);
访问
浏览器输出结果:
Closure
func
name:test.closure
p1p2hehe1hehe2
转自:小谈博客
更多关于PHP相关内容感兴趣的读者可查看本站专题:《php操作office文档技巧总结(包括word,excel,access,ppt)》、《php日期与时间用法总结》、《php面向对象程序设计入门教程》、《php字符串(string)用法总结》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》-php入门ppt
希望本文所述对大家PHP程序设计有所帮助。