AI & ML with PHP
44 subscribers
10 photos
39 links
This channel is intended for developers, who interesting in using AI and ML with PHP.
Download Telegram
OMG! Sam Altman was right and I'm wrong...

Today, the first time I editied my previously written code with Chat GPT directly without copy-paste by voice command.
Ream more: https://help.openai.com/en/articles/10119604-work-with-apps-on-macos

When working with IDEs, you can ask ChatGPT to edit open files directly — no copy-pasting required. When you ask for an edit, ChatGPT will generate a diff that you can review and apply, and there’s also an option to automatically apply edits. Diffs are easy to revert in the ChatGPT UI, or by using CMD+Z in your editor.
👍6
Machine Learning Capabilities in PHP
Yes, I do and I use it in my projects.

When people talk about machine learning, PHP rarely comes up. Python and R dominate the conversation — and for good reason. But here’s an interesting fact: PHP still powers nearly 75% of the web (https://w3techs.com/technologies/details/pl-php), and in recent years, it’s been quietly gaining machine learning capabilities.

Why should you, PHP developer, care?
Because now you can build smarter web apps — like recommendation engines, predictive analytics, or spam filters — without leaving PHP.

Here are some PHP libraries bringing ML to the table:

🔹 Rubix ML (https://rubixml.com) – A modern, production-ready library with support for neural networks, decision trees, clustering, and more. It also includes tools for data prep and evaluation.

🔹 PHP-ML (https://php-ml.readthedocs.io) – One of the first full-featured ML libraries in PHP. Offers popular algorithms like k-NN and SVM. Ideal for adding basic ML features without deep expertise.

But it doesn’t stop there. PHP is also getting stronger in scientific computing:

▪️ NumPower (https://numpower.org) – A high-performance extension with GPU acceleration via CUDA. Comparable to NumPy in Python.

▪️ MathPHP (https://github.com/markrogoyski/math-php) – A robust math library written entirely in PHP. No external dependencies.

▪️ RubixML/Tensor (https://github.com/RubixML/Tensor) – Provides fast tensor and matrix operations, optimized for PHP-based data science.

Interesting fact: RubixML and Tensor are written in native PHP, proving that you don’t need Python to get decent ML performance — especially for web-scale problems.

Want to connect with more powerful ML tools?
You can combine PHP with TensorFlow.js or Brain.js. These run in the browser (JavaScript) and send results back to your PHP backend — great for hybrid web apps.

Of course, PHP may not be the first choice for machine learning, but it's growing quietly in that space. For us, PHP developers, that means we can add intelligence to our apps using the tools we already know.
👍4
Last Trend for PHP + AI. May be this is new upward trend line? Who knows...
🤔3👍1
The MCP protocol (Message Control Protocol) plays a crucial role in enhancing communication with Large Language Models (LLM). MCP ensures reliable message exchange by managing message formatting, transmission, and error handling. This becomes particularly beneficial when interacting with LLM models.

See this video about MCP. Just few minutes of very high quality content, explaining what is MCP.
https://www.youtube.com/watch?v=qPVtVulhFC4
👍6
Windsurf Wave 7: Cascade Comes to JetBrains!

Great news! Windsurf (formerly Codeium) has launched Wave 7, bringing the full Cascade AI experience to JetBrains IDEs like IntelliJ, PhpStorm, WebStorm, and PyCharm.
https://windsurf.com/blog/windsurf-wave-7

Now you can:
✅ Use Write, Chat, and Legacy modes
✅ Access all Cascade tools inside the editor
✅ Work with AI directly in your terminal
✅ Enjoy a smooth agent-based coding flow

This is a big step for AI coding tools in JetBrains. And more features are coming soon!

🌊 It’s all Windsurf now — one name, one platform, full AI power for your PHP+ projects!
🔥6👍2❤1
Scalars, Vectors, Matrices & Tensors — The Language of ML

If you're diving into Machine Learning, don't skip the basics! 💡
Understanding scalars, vectors, matrices, and tensors is crucial — they’re the building blocks of how data is represented and processed.

🔹 Scalar → A single number (like temperature: 36.6)
🔹 Vector → A list of numbers (like pixel values in a grayscale image row)
🔹 Matrix → 2D grid of numbers (like an image with width & height)
🔹 Tensor → Multi-dimensional array (think colored videos with time, RGB, height & width!)

From feeding input to a neural network to backpropagation — it's all tensors under the hood.

Master these, and you're speaking the native tongue of ML models.
You may see the code example for each of these elements:
https://aiwithphp.org/examples/mathematics/index
Read curefully:
https://apphp.gitbook.io/artificial-intelligence-with-php/machine-learning/mathematics-for-ml/linear-algebra
👍6
Using spaCy with PHP: Natural Language Processing in Your PHP Apps!

Did you know you can harness the power of spaCy (https://spacy.io) - one of Python’s most advanced NLP libraries - even in a PHP project? Here’s how! 👇

This library - spaCy - offers fast and accurate tokenization, named entity recognition, part-of-speech tagging, and more. While PHP isn’t natively built for NLP, you can bridge the gap with Python.

But, your may easily integrate spaCy with PHP
1. Create a Python script
Use spaCy to process text and output results as JSON. Example:

# nlp.py
import spacy
import sys
import json

nlp = spacy.load("en_core_web_sm")
text = sys.argv[1]
doc = nlp(text)

result = {
"tokens": [token.text for token in doc],
"entities": [(ent.text, ent.label_) for ent in doc.ents]
}
print(json.dumps(result))


2. Call the script from PHP

$text = "Elon Musk founded SpaceX in 2002.";
$escapedText = escapeshellarg($text);
$command = "python3 nlp.py $escapedText";
$output = shell_exec($command);
$result = json_decode($output, true);

print_r($result);
?>


That’s it! You now have spaCy-powered NLP inside your PHP app. It's perfect choice for chatbots, content tagging, semantic search, or anything involving language understanding.
👍4👏1
The most popular ML library in PHP reaches 1,000,000 downloads. Only last 24h - more than 10,000 - here we go!
👍4❤2🔥2
PHP - Oh Really, Tensors?

Extension for PHP, that provides high performance tensor mathematics. It supports a wide range of mathematical operations on tensors, including element-wise computations, reductions, linear algebra functions, and more.

https://github.com/krakjoe/ort
👍5
Announcing the Official PHP SDK for MCP

The Model Context Protocol (MCP) is an open protocol introduced by Anthropic to enable AI applications to connect with and utilize external tools and data sources, akin to a standardized "USB-C port" for AI systems.

https://thephp.foundation/blog/2025/09/05/php-mcp-sdk/
👍5