$url_path = 'http://www.sina.com.cn/abc/de/fg.php?id=1'; $temp = pathinfo($url_path,PATHINFO_BASENAME); $temp = explode("?", $temp); $temp1 = substr($ ...
分类:
Web程序 时间:
2016-04-13 20:42:03
阅读次数:
164
pathinfo() 返回一个关联数组包含有 path 的信息。 包括以下的数组元素: [dirname] [basename] [extension] 提示和注释 注释:如果不是要求取得所有单元,则 pathinfo() 函数返回字符串。 提示和注释 注释:如果不是要求取得所有单元,则 pathi ...
分类:
其他好文 时间:
2016-04-13 14:40:45
阅读次数:
157
(一)<?php$base_path = "./upload/"; // 接收文件目录$target_path = $base_path . basename ( $_FILES ['uploadfile'] ['name'] );if (move_uploaded_file ( $_FILES [ ...
分类:
Web程序 时间:
2016-04-08 19:53:42
阅读次数:
128
读取脚本
递归遍历读取scriptPath目录下的脚本文件,排除掉install.sh和config.ini。
do_file()
{
for file in $1/*
do
if [[ -d "$file" ]]; then
do_file "$file"
else
basename=...
分类:
其他好文 时间:
2016-03-31 14:49:19
阅读次数:
214
目录 opendir readdir closedir 文件 filetype filesize is_file basename dirname pathinfo 文件+目录 file_exist ...
分类:
Web程序 时间:
2016-03-30 12:39:58
阅读次数:
125
for typefile in $filedir_f_2(文件夹路径) do typefn=$(basename $typefile)// 获取文件名 typeprefix=${typefn:0:10}// 截取字符串 根据实际情况 0:10 进行修改 if [ "$typeprefix" = 'f
分类:
系统相关 时间:
2016-03-22 13:48:37
阅读次数:
217
os.path.abspath(path) #返回绝对路径os.path.basename(path) #返回文件名os.path.commonprefix(list) #返回list(多个路径)中,所有path共有的最长的路径。os.path.dirname(path) #返回文件路径os.pat
分类:
编程语言 时间:
2016-03-17 21:24:08
阅读次数:
198
[root@steven ~]# cat /sbin/service#!/bin/sh. /etc/init.d/functionsVERSION="$(basename $0) ver. 0.91"USAGE="Usage: $(basename $0) < option > | --status
分类:
其他好文 时间:
2016-03-14 13:45:25
阅读次数:
135
在写代码过程中常用到一些好用的小模块,现整理汇总一下: 1、获取当前的文件名和目录名,并添到系统环境变量中。 file = os.path.abspath(__file__) #获取文件的绝对路径file_name = os.path.basename(file) #获取文件名file_dir =
分类:
编程语言 时间:
2016-03-06 14:13:24
阅读次数:
211
pathinfo <?php $test = pathinfo("http://localhost/index.php"); print_r($test); ?> 结果如下 Array ( [dirname] => http://localhost //url的路径 [basename] => in
分类:
Web程序 时间:
2016-03-04 15:57:02
阅读次数:
210