Skip to content

Instantly share code, notes, and snippets.

@lbvf50mobile
Last active October 7, 2020 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbvf50mobile/5c9014db0e13fb84c8c35ec31584d502 to your computer and use it in GitHub Desktop.
Save lbvf50mobile/5c9014db0e13fb84c8c35ec31584d502 to your computer and use it in GitHub Desktop.
Just PHP FUN 122.
<?php
# https://www.codewars.com/kata/5844e0890d3bedc5c5000e54 File Path Operations.
class FileMaster {
public function __construct($filepath){
$this->f = $filepath;
$this->x = pathinfo($filepath);
}
public function extension(){
return $this->x['extension'];
}
public function filename(){
return $this->x['filename'];
}
public function dirpath(){
return $this->x['dirname'] . '/';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment