What are best practices for organizing and naming PHP files within a project?

Organizing and naming PHP files within a project is important for maintainability and readability. One common best practice is to group related files together in directories based on functionality or module. Additionally, using meaningful and descriptive file names can make it easier to understand the purpose of each file.

// Example of organizing and naming PHP files within a project
// Directory structure:
// - controllers/
//   - UserController.php
//   - ProductController.php
// - models/
//   - User.php
//   - Product.php
// - views/
//   - user/
//     - index.php
//     - profile.php
//   - product/
//     - index.php
//     - detail.php