
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1060 Articles for PHP

14K+ Views
The make:migration Artisan in Laravel (9) enables you to generate a database migration. You can find the resultant migration files are the database/migrations directory. Using this command, we can add a new column to a table (in addition to other operations). Syntax First of all let us first create a table using the make:migration command. Following is the syntax to create a new table in Laravel using this command − php artisan make:migration create_yourtablename_table Here, the table name is your_table_name. So let us create a table with the name: students. The command to create table students is as follows ... Read More

33K+ Views
If you have an image stored in the public folder of Laravel, you can access or, display it in the browser using various methods. In this article, we will learn some of these methods. Assume we have the image of a flower (flower.jpg) stored in the Public folder as shown below Now let us use the image to view inside the browser. Using url() method The url() helper function helps to return you the full path i.e., it will add the HTTP or HTTPS and return the complete path for the given URL. For example, consider the following URL ... Read More

7K+ Views
The server IP will be the IP address of the server you are connected to. When you are working with Laravel to get the server IP you can make use of $_SERVER['SERVER_ADDR']. The $_SERVER variable acts as a global variable in PHP. It holds details like header information, script location, and other miscellaneous details. Example 1 The following example retrieves the details of the $_SERVER global variable.

18K+ Views
Before we answer the above question, let us first understand what collections are in Laravel. Collection in Laravel is an API wrapper that helps you deal with different operations to be performed on arrays. It makes use of the class Illuminate\Support\Collection to deal with arrays in Laravel. To create a collection from a given array you need to make use of the collect() helper method that returns a collection instance. Later you can use a chain of methods like converting to lowercase and sorting on the collection instance. Example The example in this section demonstrates how to create a collection from ... Read More

2K+ Views
Many developers will indeed agree that comparing C Programming and PHP is unfair because they differ in web development. PHP is by far the most famous serverside scripting language. JavaScript works with things on the client end without ever returning to the server, while PHP manages things on the application server. PHP is based on the C programming language, thus everyone with a basic understanding of C will find it easy to learn PHP. What is PHP? PHP is a general−purpose programming language that is primarily utilized in the development of websites. It was developed in 1994 by DanishCanadian programmer ... Read More

312 Views
A grapheme is the smallest functional unit of a writing system. Graphemes can be interpreted as the smallest units of writing that correspond with sounds.The grapheme_strlen() function in PHP is used to get the string length in grapheme units. This function does not get the byte or character's length. The grapheme_strlen function is supported in PHP 5.3.0 and higher versions.Syntaxinteger grapheme_strlen($str_string)Parametersgrapheme_strlen() accepts only one parameter −$str_string − The string parameter is used to measure the length of the string and it must use a UTF-8 encoding string.Return ValuesThis function returns the length of the string on success or it returns ... Read More

555 Views
The idn_to_ascii() function in PHP is used to convert a Unicode domain name into IDNA ASCII form. IDNA stands for Internationalizing Domain Names in Applications. It is a mechanism for handling internationalized domain names containing nonASCII characters.Syntaxstring idn_to_ascii( str $domain, integer $flags=IDNA_DEFAULT, integer $variant=INTL_IDNA_VARIANT_UTS46, arr &$idna_info=null )Parametersidn_to_ascii() accepts the following four parameters −$domain − This is the domain to be converted; it must be UTF-8 encoded.$flags − This parameter is a combination of IDNA_*constants.$variant − This parameter uses either INTL_IDNA_VARIANT_2003 for IDNA 2003 or INTL_IDNA_VARIANT_UTS46 for UTS#46.$idna_info − ... Read More

931 Views
The EXIF (Exchangeable image file format) PHP extension enables to work with the metadata from the images taken by digital devices like digital cameras, cell phones, etc. It depends on the image file format. We can retrieve embedded thumbnails of images.The exif_imagetype() function in PHP is used to determine the type of an image. This function reads the first bytes of a given image and checks its signature. It can also be used to avoid calls to other EXIF functions with unsupported file types or in conjunction with $_server['http_accept'] to check whether or not the viewer can see the specific ... Read More

1K+ Views
The exif_read_data() function in PHP reads the EXIF (Exchangeable image file format) headers from an image file. This function extracts all the EXIF headers from an image file.SyntaxArray exif_read_data( str $file, str $section=null, bool $arrays=false, bool $thumbnail=false )Parametersexif_read_data() accepts the following four parameters −$file − This parameter is used to specify the location of an image file.$section − This parameter specifies a comma-separated list of sections that need to be present in the file to produce a resultant array.$arrays − This parameter specifies whether or not to present ... Read More

648 Views
The bindtextdomain() function in PHP is used to set or get the path of a domain.Syntaxstring bindtextdomain($str_domain, $str_directory)Parametersbindtextdomain() accepts two parameters −$str_domain − This is the domain.$str_directory − This is the directory path. If the directory path is NULL, then it will return the currently set directory.Return Valuesbindtextdomain() returns the full specified pathname for the domain which is currently set. It will return False on the failure.ExampleOutputC:\xampp\htdocs