9 killer PHP projects, come and collect them for use!
PHP has been developed for so many years and there are many interesting projects. Let’s get rid of those pesky CRUDs and learn about these fun projects.
1. php-ai/php-ml, an advanced PHP machine learning library
php-ml is a machine learning implementation using PHP The library includes algorithms, neural networks, cross-validation, preprocessing, feature extraction and other commonly used functional solutions in the field of artificial intelligence.
The official also provides numerous cases, such as:
Detecting language classification
MNIST recognizes handwritten fonts (standard Artificial intelligence introductory project)
Spam filtering
Article classification
Predict the quality of wine
php-ml has a complete documentation and rich blog articles. But this is already the field of artificial intelligence, and your knowledge structure may not be able to be used for a while.
The simple usage is as follows:
require_once __DIR__ . '/vendor/autoload.php'; use Phpml\Classification\KNearestNeighbors; $samples = [[1, 3], [1, 4], [2, 4], [3, 1], [4, 1], [4, 2]]; $labels = ['a', 'a', 'a', 'b', 'b', 'b']; $classifier = new KNearestNeighbors(); $classifier->train($samples, $labels); $classifier->predict([3, 2]); // return 'b'
2. rindow/rindow-neuralnetworks, an advanced PHP neural network library
This is also an artificial The smart project is an advanced PHP neural network library that can use PHP to implement a powerful machine learning project.
It has the following characteristics:
can easily implement DNN, CNN, RNN and Attention machine learning models
and Python's Keras is very similar, you can use relevant experience
Provides machine vision and natural language processing in machine learning
The processing performance is Twice the tensorflow CPU
No need for a special operating environment, can run in any computer environment
Comes with interesting sample programs
And there are related calculation extensions to improve performance. There is also an extension to the GPU, which can use the computing power of the GPU to further improve performance, but this is still in the testing stage.
3. rubix/ml, an advanced PHP machine learning and deep learning library
Yes, here is another introduction An artificial intelligence library for PHP.
He has the following characteristics:
Very developer-friendly interface method call
40 kinds of supervision or unsupervised learning methods
Supports ETL, preprocessing and cross-validation
Compared to the above two, it provides the most Tutorials and sample projects of tutorials and sample projects, the more interesting of which include divorce prediction, DOTA2 winning rate prediction, etc., and a communication channel for the Telegram group is provided.
4. nlp-tools/nlp-tools, a semi-advanced natural language processing library for beginners
This is a library specifically designed to deal with the field of natural language processing in artificial intelligence. The methods it provides are lower-level than the previous ones, but they are still elegant to use.
It has built-in multiple classification models, clustering methods, word segmenters, data sets, etc., and almost all the tools and data needed for this collection.
Compared with several projects introduced before, it is specially designed to deal with the field of natural language and is very friendly to beginners. It has rich documentation and a complete set of built-in tools and data.
Here is a demonstration of the word segmentation effect:
include('vendor/autoload.php'); use NlpTools\Tokenizers\WhitespaceAndPunctuationTokenizer; $text = "Please allow me to introduce myself I'm a man of wealth and taste"; $tok = new WhitespaceAndPunctuationTokenizer(); print_r($tok->tokenize($text)); // Array // ( // [0] => Please // [1] => allow // [2] => me // [3] => to // [4] => introduce // [5] => myself // [6] => I // [7] => ' // [8] => m // [9] => a // [10] => man // [11] => of // [12] => wealth // [13] => and // [14] => taste // )
5. workerman/gateway-worker, a distributed long link service framework
GatewayWorker is based on Workerman A project framework developed to quickly develop TCP long-connection applications, such as app push servers, instant IM servers, game servers, Internet of Things, smart homes, etc.
Compared with other such solutions, it provides several incomparable advantages:
Built-in process daemon, you can use a simple command line Stable operation, no need to implement background operation or process daemon by yourself
Built-in distributed design, can achieve distributed deployment without modifying any code
Complete long link operations, including binding UID to connections, binding groups to connections, maintaining SESSION, etc.
Provides standard usage of push messages within the system. Provides a client that can send messages to the gateway network at any time
gatewayworker solves almost all pain points in long link development and is very easy to use. It should be noted that it is a framework designed for long connections. If it is a short connection (UDP), other solutions are required.
The startup method is as follows. No more operations are required to robustly complete the process daemon and restart smoothly.
1) Start
Start in debug mode
php start.php start
-
Start in daemon mode
php start.php start -d
2) Stop
php start.php stop
3) Restart
php start.php restart
4) Smooth restart
php start.php reload
5) Check status
php start.php status
6、robmorgan/phinx,一个数据库迁移工具
什么是数据库迁移工具呢,你可以先这样理解,就是一个数据库导入工具。
一般的如果我们需要导入数据库,需要先去之前的数据库导出sql文件,然后到另一个站点上导入sql文件。似乎这是天经地义的,没什么更好的方法,再好一点也就是做一个一键安装脚本。
其实有更好的方案,就是用数据库迁移工具phinx,在安装数据库时,不需要导出和导入sql文件,而是直接使用phinx提供的方法,设计好表结构,然后通过phinx的命令导入。
这样有很多好处:
更优雅的安装方式,与系统代码一起管理,无需导出sql文件
支持数据库升级降级,可以跟随系统升级,自动对比数据表变化,不用担心数据丢失
支持多款数据库,在phinx设计的表结构可以直接安装到Mysql、PostgreSQL、SQLite、SQL Server
phinx绝对是现代的程序安装解决方案,你值得投入精力去使用它。
它的基本的用法像这样:
<?php use Phinx\Migration\AbstractMigration; class CreateUserLoginsTable extends AbstractMigration { public function change() { // 创建表结构 $table = $this->table('user_logins'); $table->addColumn('user_id', 'integer') ->addColumn('created', 'datetime') ->create(); } }
7、league/flysystem,一个PHP的万能的文件存储操作库
flysystem是一个PHP的文件操作库,比如文件的读取、写入、目录列表等等操作。与众不同的是,他是“万能的”。其实说它是万能的有些夸张了,但是他官方支持了以下系统:
本地存储
FTP存储
SFTP存储
内存存储
亚马逊云存储
谷歌云存储
WebDAV存储
在社区生态中,还支持我们经常接触的一些系统:
阿里云存储
七牛云存储
Dropbox存储
腾讯云存储
华为云存储
等等,如果你需要,也可以自定义驱动。
就像下面的代码一样,对文件的操作是通用兼容的,如果需要切换存储系统,换一个驱动就可以了。
// 设置驱动 $adapter = new League\Flysystem\Local\LocalFilesystemAdapter($rootPath); $filesystem = new League\Flysystem\Filesystem($adapter); // 操作文件、目录 $filesystem->write($path, $contents); $filesystem->read($path); $filesystem->delete($path); $filesystem->listContents($path, $recursive); $filesystem->fileExists($path); $filesystem->has($path); $filesystem->lastModified($path); .....
8、PHP-CPP,一个C++的PHP扩展开发框架
相比介绍的前几个项目,PHP-CPP并不是一个PHP的扩展或库,它是一个C++的框架,用来开发PHP扩展。
众所周知,PHP的扩展开发很困难,你一搜PHP的扩展开发,所有人都告诉你那可怕的Zend API,就像遇见了伏地魔一样,人们不敢提起它。
PHP-CPP解决了这样的混乱的Zend API的问题,实际上他解决了很多问题,使用他开发PHP扩展,写起C++代码来就像写PHP一样,毕竟PHP的语法也参考了C风格。
就像下面这样,简单几行就完成了一个PHP扩展。
#include <phpcpp.h> #include <iostream> void myFunction() { Php::out << "example output" << std::endl; } extern "C" { PHPCPP_EXPORT void *get_module() { static Php::Extension extension("my_extension", "1.0"); extension.add<myFunction>("myFunction"); return extension; } }
PHP-CPP还提供了丰富的文档和注释,手把手教你如何注册函数、调用函数、匿名函数、类和对象、解析和构造、魔术方法等。
9、PHP-FPM,一个强大的稳定的HTTP服务框架
很多人总是忽视这个PHP-FPM,甚至嫌弃他。
实际上,PHP-FPM是一个大杀器,
稳定的运行
丰富的扩展
性能进阶方案
在Web中仍然闪闪发光。
原文地址:https://phpreturn.com/index/a624ac38895749.html
原文平台:phpreturn(PHP武器库)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.