标签归档:php

php保存execl

php可以将数据保存为execl,有很优秀的类库来进行操作。不过今天我要介绍的方法,非常简单,不需要引入第三方类库,只需要加上header就可以让浏览器保存execl.

header("Content-type:application/vnd.ms-excel");

header("Conten-Disposition:filename=hp.xlsx");

将这两行加入到输出语句之前。然后输出一个table表格,访问这个页面就会提示保存为execl。非常方便

php上传大文件修改配置

上传的文件,是有大小控制的,需要在php.ini中设置一个upload和post的大小,否则会出现这个问题

一个是post_max_size = 100M

一个是upload_max_filesize = 100M

这两个配置项都需要修改,否则会出现上传的大文件php接收不到。

Why I more like phpstorm than sublime with php

I am phper, in my worktime, i use phpstorm to write code.

before i use phpstorm, i often use the sublime. i like it simple, fast, and beautiful themes.it has many useful plugins,such as codeintel,and emmet,git .. because these plugins, i use it as my php editor. 

But when i see the phpstorm, i was attacted by it. it can be called a php god editor. you can write a oo code by it very fast. you can quickly get the word which the project has it. it supports mostly frameworks. 

when i use it write html code, it supply the css prompt quickly. i don't use to keep many css styles in my mind.

it also has a strong debug method. when you install xdebug in browser. you can debug the code very conveniently.

you refresh the browser, it will hit the breakpoint.you can watch the variables detaily.

it has many advantages, you can try it and fall in love with it.

sublime text 调试php

sublime是一个小巧快速的编辑器,对于php的编辑来说,他优雅中不失敏捷,下面我来介绍下sublime中的php如何调试。首先需要安装xdebug-client这个插件,你可以通过package-control这个包管理器来安装,这个我就不详细介绍了。

然后google商店添加google扩展,xdebug helperblob.png

浏览器页面中就可以看到xdebug图标,将其激活。然后配置xdebug为监听sublime.

blob.png

然后在sublime中设置断点,启动调试器ctrl+shift+9

blob.png

可以监听调试,然后你就会看到调试窗口了,

blob.png

调试中的快捷键,以及如何单步调试,你可以参考这里

https://github.com/martomo/SublimeTextXdebug