Tagged articles
126 articles
Page 2 of 2
Laravel Tech Community
Laravel Tech Community
Sep 24, 2020 · Backend Development

PHP str_repeat Function – Repeating a String

The article explains PHP's str_repeat function, which repeats a given string a specified number of times, details its parameters, return value, usage constraints, and provides a sample code snippet demonstrating its output.

BackendStringfunction
0 likes · 1 min read
PHP str_repeat Function – Repeating a String
Laravel Tech Community
Laravel Tech Community
Sep 15, 2020 · Backend Development

PHP is_dir() Function: Determine if a Path is a Directory

This article explains the PHP is_dir() function, describing its purpose to check whether a given filename refers to an existing directory, detailing its parameter, return values, and providing example code snippets demonstrating true and false outcomes for various path inputs.

BackendPHPfile system
0 likes · 2 min read
PHP is_dir() Function: Determine if a Path is a Directory
Laravel Tech Community
Laravel Tech Community
Sep 6, 2020 · Backend Development

PHP str_split() Function – Convert a String to an Array

The article explains PHP's str_split() function, which converts a string into an array of characters or fixed‑length chunks, details its parameters and return behavior, and provides example code with output, including demonstrating how split_length affects the result.

ArrayBackendPHP
0 likes · 2 min read
PHP str_split() Function – Convert a String to an Array
Laravel Tech Community
Laravel Tech Community
Aug 27, 2020 · Backend Development

PHP trim() Function: Removing Whitespace and Specified Characters

This article explains PHP's trim() function, detailing how it removes leading and trailing whitespace or custom characters, describes its parameters and return value, and provides multiple code examples demonstrating default usage, custom character lists, and applying trim via array_walk.

.trimBackendString
0 likes · 3 min read
PHP trim() Function: Removing Whitespace and Specified Characters
Laravel Tech Community
Laravel Tech Community
Jul 27, 2020 · Backend Development

Mastering PHP’s pclose(): Properly Closing Process Pipes

This guide explains the PHP pclose() function, its signature, how it closes a process opened with popen(), the required handle parameter, the return values indicating the process termination status, and provides a clear example demonstrating its correct usage.

BackendPHPfunction
0 likes · 2 min read
Mastering PHP’s pclose(): Properly Closing Process Pipes
Laravel Tech Community
Laravel Tech Community
Jul 1, 2020 · Backend Development

How to Convert Newlines to HTML Breaks with PHP’s nl2br Function

Learn how PHP's nl2br function inserts HTML line break tags before every newline in a string, understand its optional XHTML mode, see detailed parameter explanations, and explore three practical code examples demonstrating different newline scenarios and their resulting HTML output.

BackendHTMLPHP
0 likes · 2 min read
How to Convert Newlines to HTML Breaks with PHP’s nl2br Function
MaGe Linux Operations
MaGe Linux Operations
May 22, 2019 · Fundamentals

Why Python Closures Print 6,6,6,6 and How to Get 0,2,4,6

An unexpected Python interview question demonstrates how late binding in closures causes all lambdas to use the final loop value, producing 6,6,6,6 instead of 0,2,4,6, and the article explains the underlying reason and presents four practical solutions to achieve the intended output.

LambdaPythonclosures
0 likes · 4 min read
Why Python Closures Print 6,6,6,6 and How to Get 0,2,4,6
MaGe Linux Operations
MaGe Linux Operations
Jul 9, 2017 · Fundamentals

Master Python Decorators: From Basics to Advanced Usage

This article provides a comprehensive guide to Python functions, scopes, variable lifecycles, closures, and decorators, illustrating each concept with clear explanations and runnable code examples, and shows how to create flexible, reusable decorators using @ syntax, *args, and **kwargs.

Decoratorargsclosure
0 likes · 22 min read
Master Python Decorators: From Basics to Advanced Usage
Java High-Performance Architecture
Java High-Performance Architecture
Oct 13, 2015 · Frontend Development

Understanding JavaScript Hoisting: Why console.log(test) Returns Undefined

JavaScript executes code by first compiling function and var declarations within a scope, then running statements top‑to‑bottom, which explains why accessing a var‑declared variable before its assignment yields undefined while referencing an undeclared variable throws an error, as illustrated through detailed examples.

JavaScriptVarexecution
0 likes · 4 min read
Understanding JavaScript Hoisting: Why console.log(test) Returns Undefined