迹忆客 EN >

所有文章

Using if...else shorthand in PHP

发布时间:2025/04/12 作者:JIYIK 分类:PHP

This article will show you how we can use shorthand methods to write conditionals in PHP if...else . We will use the ternary operator and the null coalescing operator in our demonstration. Introduction to PHP ternary operator We can use the...

查看全文

Reading text files in PHP

发布时间:2025/04/12 作者:JIYIK 分类:PHP

This article will introduce the method of reading text files line by line in PHP. fgets() Use the function to read a text file line by line in PHP We can read a text file line by line in PHP using the while read_line function with a loop. T...

查看全文

Printing to the console in PHP

发布时间:2025/04/12 作者:JIYIK 分类:PHP

This article explains how to write to the console in PHP. console.log() Writing to the console using JavaScript from PHP We can write to the console using some JavaScript from PHP. We use in JavaScript console.log() to write anything to the...

查看全文

Get JSON object from URL in PHP

发布时间:2025/04/12 作者:JIYIK 分类:PHP

This article explains how to get a JSON object from a URL in PHP. file_get_contents() Get JSON object from URL in PHP using function We can use the README.mdl file_get_contents() and README.mdl json_decode() to get a JSON object from a URL....

查看全文

Running PHP on Mac

发布时间:2025/04/12 作者:JIYIK 分类:PHP

In this article, we'll show you how to run PHP on your Mac. php -S Run PHP on Mac using command PHP is a server-side language. It runs on a server. Therefore, it requires a web server to run. There are different web servers like Apache HTTP...

查看全文

Sending attachments in emails using PHP

发布时间:2025/04/12 作者:JIYIK 分类:PHP

We will look at different ways to send attachments via email in PHP. PHPMailer Send attachments in email using We can use PHPMailer the SendEmail class to send emails, allowing us to send attachments. We can create an PHPMailer object of th...

查看全文

Run Shell Scripts and Open Shell Files in PHP

发布时间:2025/04/12 作者:JIYIK 分类:PHP

Run Shell Scripts and Open Shell Files in PHP

PHP allows us to use shell_exec(); the shell function to process files. However, if your operating system is Windows, you should consider using the popen() and pclose() functions, because pipes are executed in text mode, which usually preve...

查看全文

Validating phone numbers in PHP

发布时间:2025/04/12 作者:JIYIK 分类:PHP

PHP has two ways to validate phone numbers, one is regular expression regex and the other is filter the method. We can use to regex set a template and validate the phone number based on that template, but filter will only exclude the unwant...

查看全文

Writing error log files in PHP

发布时间:2025/04/12 作者:JIYIK 分类:PHP

When we have a large web application running in production mode, we need to monitor all errors or potential errors that our users may face. The best way to keep an eye on all possible errors is to log them to a file as they occur. This arti...

查看全文

Validating Email in PHP

发布时间:2025/04/12 作者:JIYIK 分类:PHP

We will introduce a method to validate email addresses in PHP using filter_var() the function and FILTER_VALIDATE_EMAIL filter name ID. filter_var() The function takes an email as the first parameter and a filter name FILTER_VALIDATE_EMAIL...

查看全文

Sending Emails Using the Mail Form in PHP

发布时间:2025/04/12 作者:JIYIK 分类:PHP

This article will demonstrate installing sendmail the library and sending an email through the PHP mail form. Install sendmail to send email from PHP on local server PHP has a built-in function mail() to send emails. However, this function...

查看全文

Implementing callback functions in PHP

发布时间:2025/04/12 作者:JIYIK 分类:PHP

This article will show you how to create one or more callback functions and execute them using different built-in methods, user-defined functions, and static classes in PHP. Create a function in PHP callback and call_user_func execute it us...

查看全文

扫一扫阅读全部技术教程

社交账号
  • https://www.github.com/onmpw
  • qq:1244347461

热门文章

热门标签

扫码一下
查看教程更方便