定制 bitandblack/pathinfo 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bitandblack/pathinfo

Composer 安装命令:

composer require bitandblack/pathinfo

包简介

Easy handling of path information in an object-oriented way.

README 文档

README

PHP from Packagist Latest Stable Version Total Downloads License

Bit&Black PathInfo

Easy handling of path information in an object-oriented way.

Installation

This library is made for the use with Composer. Add it to your project by running $ composer require bitandblack/pathinfo.

Usage

Initialize the PathInfo with a path:

<?php

use BitAndBlack\PathInfo\PathInfo;

$pathInfo = new PathInfo('/path/to/myfile.jpg');

You can access the single parts of the path now like that:

<?php

/** Will echo "myfile" */
echo $pathInfo->getFileName();

/** Will echo "jpg" */
echo $pathInfo->getExtension();

You can also modify the parts:

<?php

use BitAndBlack\PathInfo\PathInfo;

$pathInfo = new PathInfo('/path/to/myfile.jpg');

/** Will echo "/path/to/myfile.jpg" */
echo $pathInfo->getFilePath();

$pathInfoModified = $pathInfo
    ->withFileNameAppended('-modified')
    ->withExtension('png')
;

/** Will echo "/path/to/myfile-modified.png" */
echo $pathInfoModified->getFilePath();

Help

If you have any questions, feel free to contact us under hello@bitandblack.com.

Further information about Bit&Black can be found under www.bitandblack.com.

统计信息

  • 总下载量: 11.05k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 9
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固