Practical solutions

PHP Howtos How-To Guides

Solve the problem. Keep building. Collection of PHP how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Change Font Size and Color in PHPDiscover practical techniques for integrating PHP with CSS to dynamically style web content, including changing font size and color, using inline styles, separate PHP files, and CSS classes. This comprehensive guide offers clear examples, syntax explanations, and code analyses for effective PHP and CSS collaboration in web development. How to Convert an Array to an Object in PHPThis article introduces how to convert an array to an object in PHP. It includes type casting, json_decode() function and json_encode() function. How to Check Whether an Array Is Empty in PHPThis article introduces how to check whether an array is empty in PHP. It includes empty() function, sizeof() function, count() function and NOT operator. How to Get Parameters From a URL String in PHPThis article introduces how to get parameters from a url string in PHP. It includes parse_url() function, parse_str() function and $_GET variable. How to Read a Large File Line by Line in PHPThis article introduces how to read a large file line by line in PHP. It includes fgets() function, file() function and stream_get_line() function. How to Loop Through an Array in PHPThis article introduces how to loop through an array in PHP. It includes foreach loop and for loop. How to Sort an Array of Associative Arrays by Value of a Given Key in PHPThis article introduces how to sort an array of associative arrays by value of a given key in PHP. It includes array_multisort() function and usort() function. How to Get a File Extension in PHPThis article introduces how to get file extension in PHP. It includes pathinfo() function and SplFileInfo() construct. How to Extract Data From JSON in PHPThis article introduces how to extract data from JSON in PHP. It includes json_decode() function. How to Check if a String Contains a Substring in PHPThis article introduces how to check if a string contains a substring in PHP. How to Add Elements to an Array in PHPThis article introduces how to add elements to an array in PHP. It includes the array_push() function and the Direct Assignment Method. How to Reset Array in PHPThis article introduces how to reset an array in PHP. It includes unset() function and array_diff() function. How to Perform Array Delete by Value Not Key in PHPThis article introduces how to perform array delete by value not key in PHP. It includes array_search() function, unset() function and array_diff() function. How to Concatenate Strings in PHPThis article introduces how to d string concatenation in PHP. It includes the concatenation operator, concatenation assignment operator, and the sprintf() function. How to Initialize Empty Array in PHPThis article introduces how to initialize an empty array in PHP. It includes square brackets and array() function. How to Format Phone Numbers in PHPThis article introduces how to format phone numbers in PHP. It includes preg_match() function and sprintf() function. How to Convert String to Float in PHPThis article introduces how to convert string to float in PHP. It includes type casting, floatval() function, and number_format() function. How to Convert XML to JSON in PHPThis article introduces how to convert xml to json in PHP. It includes simplexml_load_string() function and json_encode() function. How to Generate Random String in PHPThis tutorial demonstrates randomly generation of string in PHP How to Remove Special Character in PHPThis tutorial shows the removal of special character from string in PHP How to Read if Checkbox Is Checked in PHPThis tutorial demonstrates how to read if a checkbox is checked in PHP How to Show All Errors in PHPThis tutorial demonstrates how to display errors and warnings in PHP How to Count Rows in MySQL PHPThis tutorial demonstrates how to count the total number of rows of mysql table in PHP How to Add Line Break in PHPThis tutorial demonstrates how to add a line beak within echo in PHP