macOS Symony3 var 目录的权限设置

最近开发symfony3项目的时候,发现当使用brew安装的PHP7.1版本运行,总是会提示var目录下  failed to open stream: Permission denied 错误,当把PHP的php-fpm运行权限改对后,又发现Wordpress项目的后台打开总是出现504错误. 反正就是两个项目不能同时正确的运行,结果搞了很久都没搞定,去官网找了找才发现有这么一篇文章 Using...

PHP function : ks_tolower_ucfirst

实现以下功能: 字符串"user_name" 转换成 "UserName",  "display_name" 转换成 "DisplayName"

PHP 怎么获得 swf 视频文件的宽度和高度

做视频显示的时候,有时候需要获取swf文件的宽和高,其实只要使用一个很简单的函数就可以搞定,那就是php的内置函数 getimagesize($file),其中 $file 既可以是本地的swf文件,也可以是线上网站里面的 swf 视频文件.代码如下

<?php

$file = 'http://player.yinyuetai.com/video/player/17571/v_5449128.swf';
$result = getimagesize($file);
print_r($result);

smarty常用函数及其用法

1.smarty 截取字符串函数 truncate的用法
smarty truncate 截取字符串从字符串开始处截取某长度的字符,默认的长度为80
指定第二个参数作为截取字符串的长度
默认情况下,smarty会截取到一个词的末尾,
如果需要精确到截取多少个字符可以使用第三个参数,将其设为”true”......

Debian 6.0.4 + LAMP & APT

root@localhost:~/#
root@localhost:~/# apt-get install mysql-client mysql-server -y
root@localhost:~/# apt-get update
root@localhost:~/# apt-get install apt-spy
root@localhost:~/# apt-spy update ......

Linux系统管理常用命令

1.循环遍历当前目录所有的文件名包含 html.php 的文件
[root@ me /]# find . | grep "html.php"

2.循环遍历当前目录所有的文件名包含 html.php 的文件并删除
[root@ me /]# find . | grep "html.php" | xargs rm -rf