Tag

string comparison

1 views collected around this technical thread.

Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 10, 2025 · Fundamentals

Strange Behaviors in Java: Integer Caching, String Comparison, Unary Plus, and Unicode Tricks

This article explains several counter‑intuitive Java behaviors—including integer caching with configurable range, string literal pool versus new objects, the unary plus being a sign rather than an operator, and Unicode escape processing that can make commented code execute—providing code examples and practical insights.

JavaUnicodeinteger caching
0 likes · 5 min read
Strange Behaviors in Java: Integer Caching, String Comparison, Unary Plus, and Unicode Tricks
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 3, 2025 · Databases

MySQL Trailing Space Issue: Unexpected Matching of Strings with Trailing Spaces

An investigation reveals that MySQL treats trailing spaces in VARCHAR values as insignificant during string comparison, causing queries like SELECT * WHERE name='Tom' to match rows with extra spaces, and demonstrates that using the BINARY keyword restores exact matching, highlighting a potential bug in MySQL 5.7.

MySQLbinarybug
0 likes · 4 min read
MySQL Trailing Space Issue: Unexpected Matching of Strings with Trailing Spaces
php中文网 Courses
php中文网 Courses
Feb 20, 2025 · Backend Development

Understanding PHP strcmp() Function: Syntax, Return Values, and Examples

The article explains PHP's strcmp() string comparison function, detailing its ASCII‑based comparison logic, syntax, return values, and provides three practical code examples demonstrating how to determine equality, less‑than, or greater‑than relationships between strings.

Code ExamplePHPbackend development
0 likes · 4 min read
Understanding PHP strcmp() Function: Syntax, Return Values, and Examples
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jan 11, 2024 · Databases

MySQL Ignoring Trailing Spaces in VARCHAR Values and How to Enforce Exact Matching

This article demonstrates how MySQL silently discards trailing spaces in VARCHAR columns during queries, shows example tables and queries where spaces are ignored, and explains how to use the BINARY keyword to enforce strict matching of trailing spaces.

MySQLSQLbinary
0 likes · 4 min read
MySQL Ignoring Trailing Spaces in VARCHAR Values and How to Enforce Exact Matching
php中文网 Courses
php中文网 Courses
Dec 23, 2023 · Backend Development

Understanding PHP strcmp() Function: Syntax, Parameters, Return Values, and Examples

This article explains PHP's strcmp() function, detailing its syntax, parameters, return values based on ASCII comparison, and provides three practical code examples demonstrating how to compare strings for equality, less‑than, and greater‑than relationships.

PHPTutorialbackend
0 likes · 3 min read
Understanding PHP strcmp() Function: Syntax, Parameters, Return Values, and Examples
php中文网 Courses
php中文网 Courses
Sep 6, 2023 · Backend Development

PHP strncasecmp() Function: Syntax, Parameters, Return Values, and Usage Example

strncasecmp() is a PHP string comparison function that compares the first n characters of two strings case‑insensitively, with detailed syntax, parameter explanations, return values, a practical code example, and usage notes on handling full‑string comparisons and typical applications.

PHPbackend developmentcase-insensitive
0 likes · 3 min read
PHP strncasecmp() Function: Syntax, Parameters, Return Values, and Usage Example
php中文网 Courses
php中文网 Courses
Sep 6, 2023 · Backend Development

PHP strnatcmp() Function: Natural Order String Comparison

The article explains PHP’s strnatcmp() function, which compares two strings using natural order sorting, details its syntax, demonstrates usage with code examples showing how numeric parts are evaluated, and notes the case‑sensitive behavior and the alternative strnatcasecmp() for case‑insensitive comparisons.

PHPbackendnatural sort
0 likes · 4 min read
PHP strnatcmp() Function: Natural Order String Comparison
php中文网 Courses
php中文网 Courses
Sep 4, 2023 · Backend Development

PHP strcasecmp() Function: Syntax, Parameters, Return Values, and Usage Examples

The article explains PHP's case‑insensitive string comparison function strcasecmp(), covering its syntax, parameters, return values, practical code examples, and why it is useful for handling textual data without regard to letter case.

PHPbackendcase-insensitive
0 likes · 3 min read
PHP strcasecmp() Function: Syntax, Parameters, Return Values, and Usage Examples
php中文网 Courses
php中文网 Courses
Sep 2, 2023 · Backend Development

Using PHP strcmp() Function: Syntax, Usage, and Examples

This article explains the PHP strcmp() function, covering its syntax, return values, and practical examples for comparing string equality, ordering, case sensitivity, and length, while also noting the related strcasecmp() function for case‑insensitive comparisons.

Code TutorialPHPbackend development
0 likes · 6 min read
Using PHP strcmp() Function: Syntax, Usage, and Examples
Laravel Tech Community
Laravel Tech Community
May 9, 2021 · Backend Development

hash_equals() – Constant‑Time String Comparison to Prevent Timing Attacks

The article explains PHP's hash_equals() function, which performs a constant‑time comparison of two strings to mitigate timing attacks, describes its parameters and return value, and provides example code demonstrating correct and incorrect usage with crypt() hashes.

PHPhash_equalssecurity
0 likes · 2 min read
hash_equals() – Constant‑Time String Comparison to Prevent Timing Attacks
Laravel Tech Community
Laravel Tech Community
Oct 17, 2020 · Backend Development

Binary‑Safe String Comparison with strcmp() in PHP

This article explains PHP's binary‑safe strcmp() function, detailing its case‑sensitive behavior, parameter meanings, return values, and provides a complete example demonstrating how to compare two strings and handle the result in code.

PHPTutorialbackend
0 likes · 2 min read
Binary‑Safe String Comparison with strcmp() in PHP
Laravel Tech Community
Laravel Tech Community
Jun 29, 2020 · Backend Development

PHP strncmp Function: Binary‑Safe String Comparison

The article explains PHP's strncmp function, a binary‑safe, case‑sensitive string comparison that compares the first N characters of two strings, detailing its syntax, parameters, return values, and providing practical code examples with expected outputs.

PHPbackend developmentbinary safe
0 likes · 2 min read
PHP strncmp Function: Binary‑Safe String Comparison
Laravel Tech Community
Laravel Tech Community
Jun 28, 2020 · Backend Development

PHP strcmp() Function: Usage, Parameters, Return Values, and Examples

This article explains the PHP strcmp() function, describing its binary‑safe, case‑sensitive string comparison behavior, detailing its parameters and return values, and providing multiple code examples that illustrate how different string inputs affect the function’s output.

Code ExamplePHPbackend development
0 likes · 2 min read
PHP strcmp() Function: Usage, Parameters, Return Values, and Examples