Server Side Programming Articles

Page 988 of 2109

Binary Search in PHP

Pradeep Kumar
Pradeep Kumar
Updated on 15-Mar-2026 2K+ Views

Binary search is a search algorithm used to find the position of a target value within a sorted array efficiently. It works by repeatedly dividing the search range in half and comparing the middle element with the target value. How Binary Search Works The binary search algorithm follows these steps − Start with the entire sorted array and set left pointer to first element, right pointer to last element. Calculate the middle index as the average of left and right pointers (integer division). Compare ...

Read More

Creating multiple process using fork() in C

Nitya Raut
Nitya Raut
Updated on 15-Mar-2026 2K+ Views

In this section we will see how to use the fork() system call to create child processes in C. The fork() function creates a new process by duplicating the calling process, allowing both parent and child processes to execute different tasks. When fork() is called, it returns different values to distinguish between processes: a positive value (child's PID) to the parent process, 0 to the child process, and -1 if the fork failed. Syntax #include pid_t fork(void); Note: This program requires a Unix-like operating system (Linux, macOS) to compile and run. The ...

Read More

Get and Set the stack size of thread attribute in C

Smita Kapse
Smita Kapse
Updated on 15-Mar-2026 2K+ Views

To get and set the stack size of thread attribute in C, we use the pthread_attr_getstacksize() and pthread_attr_setstacksize() functions. These functions allow us to query and modify the minimum stack size allocated to a thread's stack. Syntax int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize); int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize); pthread_attr_getstacksize() This function retrieves the current stack size from a thread attribute object. It returns 0 on success, otherwise returns an error number. Parameters: attr − Pointer to the thread attribute object stacksize − Pointer to store the retrieved stack size in bytes ...

Read More

Octal literals in C

Jennifer Nicholas
Jennifer Nicholas
Updated on 15-Mar-2026 5K+ Views

In C, we can use octal literals by typing a zero before the actual number. For example, if an octal number is 25, then we have to write 025. Octal literals use base-8 numbering system and contain only digits 0-7. Syntax 0octal_digits Where octal_digits are valid octal digits (0-7). Example The following example demonstrates how to use octal literals in C − #include int main() { int a = 025; /* Octal 25 = Decimal 21 */ int b = ...

Read More

lvalue and rvalue in C

Nitya Raut
Nitya Raut
Updated on 15-Mar-2026 9K+ Views

An lvalue (locator value) represents an object that occupies some identifiable location in memory (i.e. has an address). An rvalue is defined by exclusion − every expression is either an lvalue or an rvalue, so an rvalue is an expression that does not represent an object occupying some identifiable location in memory. Syntax lvalue = rvalue; // Valid assignment rvalue = lvalue; // Invalid assignment (compilation error) Example 1: Valid lvalue Assignment An assignment expects an lvalue as its left operand. Here's a valid example − #include int ...

Read More

PHP Program for Converting Roman Numerals to Decimal Lying Between 1 to 3999

Prabhdeep Singh
Prabhdeep Singh
Updated on 15-Mar-2026 336 Views

Roman numerals are characters used in a numeric notation system based on the ancient Roman system. In this tutorial, we'll convert Roman numeral strings to decimal values in the range 1 to 3999. Roman Numeral System Roman numerals follow descending order but use subtractive notation to avoid four consecutive characters. Here are the main symbols − SYMBOL VALUE M 1000 CM 900 D 500 CD 400 C 100 XC 90 L 50 XL 40 X 10 ...

Read More

How to Disable root Login Access to PhpMyAdmin?

Satish Kumar
Satish Kumar
Updated on 15-Mar-2026 2K+ Views

PhpMyAdmin is a popular web−based tool for managing MySQL databases through a browser interface. By default, it allows root user login, which grants complete administrative control over the entire database system. While convenient for initial setup, root access poses significant security risks if compromised. Why Disable Root Login Access? The MySQL root user has unrestricted privileges to create, modify, or delete any database, user, or configuration. If an attacker gains root credentials, they can cause irreversible damage or steal sensitive data. Additionally, root accounts are often shared among multiple users, increasing the risk of unauthorized access. Method ...

Read More

PHP Program to Check if all rows of a matrix are circular rotations of each other

Prabhdeep Singh
Prabhdeep Singh
Updated on 15-Mar-2026 222 Views

A rectangular array called a matrix is made up of rows and columns. And circular rotations entail rotating the array's elements so that after one rotation, the last member is in the first position and the other elements are shifted to the right. We are given an N*N matrix in this problem, and our objective is to determine whether all of the rows are circular rotations of one another. If they are, print "YES, " otherwise print "NO." In order to better understand the issue, let's look at some cases with explanations below. Input 1 mat ...

Read More

How to Upload Image into Database and Display it using PHP

Tarun Singh
Tarun Singh
Updated on 15-Mar-2026 16K+ Views

In modern web applications, it is common to store images in databases for various reasons, such as security, easy management, and scalability. PHP provides an easy way to upload images to databases and display them on web pages. In this article, we will learn how to upload images into database and display them using PHP. We will implement the following functionality − HTML form to upload an image Upload an image to the server using PHP Store file data in the database using PHP and MySQL Retrieve images from the database and display on the web page ...

Read More

How to Increase File Upload Size in PHP

Satish Kumar
Satish Kumar
Updated on 15-Mar-2026 21K+ Views

In today's digital world, file uploads are a common occurrence, be it uploading pictures to social media platforms or sharing documents through email. However, PHP's default file upload size limit can cause inconvenience to users, restricting them from uploading files of larger sizes. In this article, we will explore ways to increase the file upload size in PHP. Understanding PHP File Upload Size Limit PHP is a server-side scripting language that is widely used for developing dynamic web pages. When a user uploads a file to a PHP-based website, the file size limit is imposed by the PHP ...

Read More
Showing 9871–9880 of 21,090 articles
« Prev 1 986 987 988 989 990 2109 Next »
Advertisements