Server Side Programming Articles

Page 998 of 2109

PHP – grapheme_strlen() function

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 379 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 but counts the actual displayed characters, making it useful for Unicode text with combining characters. The grapheme_strlen function is supported in PHP 5.3.0 and higher versions. Note: The Intl extension must be installed and enabled to use this function. Syntax int grapheme_strlen(string $input) ...

Read More

Why C/C++ variables doesn’t start with numbers

Ravi Ranjan
Ravi Ranjan
Updated on 15-Mar-2026 2K+ Views

In C/C++, a variable name can have alphabets, numbers, and the underscore( _ ) character. There are some keywords in the C/C++ language. Apart from them, everything is treated as an identifier. Identifiers are the names of variables, constants, functions, etc. Syntax Valid identifier naming rules in C − // Valid identifier patterns: [a-zA-Z_][a-zA-Z0-9_]* // Valid examples: variable_name, _count, num1, my_var // Invalid examples: 1variable, 2name, 3_count Why Variables in C/C++ Can't Start with Numbers? In C and C++, variable names (also known as identifiers) cannot start with a digit due to ...

Read More

PHP – idn_to_ascii() function

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 637 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 non-ASCII characters. Syntax string idn_to_ascii( string $domain, int $flags = IDNA_DEFAULT, int $variant = INTL_IDNA_VARIANT_UTS46, array &$idna_info = null ) Parameters idn_to_ascii() accepts the following four parameters − $domain − This is the domain to be converted; it must be UTF-8 encoded. $flags − This ...

Read More

PHP – exif_imagetype() function

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 1K+ Views

The EXIF (Exchangeable image file format) PHP extension enables you to work with metadata from images taken by digital devices like digital cameras and cell phones. The exif_imagetype() function determines the type of an image by reading its first bytes and checking its signature. This is useful for validating file types before processing or checking browser compatibility. Syntax int exif_imagetype(string $filename) Parameters The function accepts a single parameter: $filename − Path to the image file to check Return Value Returns an integer constant representing the image type when a ...

Read More

Declare variable as constant in C

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 21K+ Views

In C programming, variables can be declared as constants using the const keyword or the #define preprocessor directive. Constants ensure that variable values cannot be modified after initialization, providing data integrity and preventing accidental changes. Syntax const datatype variable_name = value; #define CONSTANT_NAME value Method 1: Using const Keyword Variables can be declared as constants by using the const keyword before the datatype of the variable. The constant variables can be initialized once only. The default value of uninitialized constant variables is zero. #include int main() { ...

Read More

PHP – exif_read_data() function

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 1K+ Views

The exif_read_data() function in PHP reads the EXIF (Exchangeable image file format) headers from an image file. This function extracts metadata information such as camera settings, GPS coordinates, timestamps, and technical details from JPEG and TIFF images. Note: This function requires the EXIF extension to be enabled in PHP. On most systems, it's enabled by default, but you can check with extension_loaded('exif'). Syntax array|false exif_read_data( string $file, string $sections = null, bool $arrays = false, bool $thumbnail = false ) ...

Read More

Initialization of global and static variables in C

Arjun Thakur
Arjun Thakur
Updated on 15-Mar-2026 5K+ Views

In C language both the global and static variables must be initialized with constant values. This is because the values of these variables must be known at compile time before the program execution starts. An error will be generated if the constant values are not provided for global and static variables. Syntax // Global variable initialization data_type variable_name = constant_value; // Static variable initialization static data_type variable_name = constant_value; Example 1: Valid Initialization with Constants This example demonstrates the correct way to initialize global and static variables using constant values − ...

Read More

How do I find the length of an array in C/C++?

George John
George John
Updated on 15-Mar-2026 22K+ Views

To find the length of an array in C, we can use various approaches that are essential for array manipulation. Finding the length of an array is a fundamental task used in looping through arrays, sorting, searching, and memory management operations. In this article, we will explore different methods to determine the size of an array in C programming. Syntax // Method 1: Using sizeof operator int length = sizeof(array) / sizeof(array[0]); // Method 2: Using pointer arithmetic int length = *(&array + 1) - array; Method 1: Using sizeof() Operator The ...

Read More

PHP – How to get or set the path of a domain?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 694 Views

The bindtextdomain() function in PHP is used to set or get the path of a domain for internationalization (i18n) purposes. It binds a message domain to a specific directory containing translation files. Syntax string bindtextdomain(string $domain, string $directory) Parameters bindtextdomain() accepts two parameters − $domain − The message domain name (typically your application name). $directory − The directory path where translation files are stored. If NULL, it returns the currently set directory for the domain. Return Value bindtextdomain() returns the full pathname for the domain directory currently set, or ...

Read More

PHP – mb_ereg_search_init() function

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 179 Views

The mb_ereg_search_init() function in PHP initializes the string and regular expression pattern for multibyte regular expression searches. It prepares the search parameters that will be used by subsequent functions like mb_ereg_search(), mb_ereg_search_pos(), and mb_ereg_search_regs(). Syntax bool mb_ereg_search_init( string $string, string $pattern = null, string $options = null ) Parameters mb_ereg_search_init() accepts three parameters − string − The target string to search in. pattern − The regular expression pattern (optional). options − Search options like "i" for case-insensitive matching (optional). Return Value ...

Read More
Showing 9971–9980 of 21,090 articles
Advertisements