PHP array_chunk() example

Posted by Prem Tiwari | Updated on | in PHP Documentation.


PHP array_chunk() — Split an array into chunks. Chunks an array into arrays with size elements. The last chunk may contain less than size elements. Syntax: Returns a multidimensional numerically indexed array, starting with zero, …

PHP array_shift() example

Posted by Prem Tiwari | Updated on | in PHP Documentation.


array_shift — Shift an element off the beginning of array. array_shift() shifts the first value of the array off and returns it, shortening the array by one element and moving everything down. All numerical array …

PHP array_unshift() example

Posted by Prem Tiwari | Updated on | in PHP Documentation.


array_unshift — Prepend one or more elements to the beginning of an array. array_unshift() prepends passed elements to the front of the array. Note that the list of elements is prepended as a whole, so …

Restrict access to post if it is currently being edited

Posted by Prem Tiwari | Updated on | in WordPress.


In this post, you will learn how to restrict access to post if it is currently being edited in your WordPress site. The warning notice gets dispatched by the function wp_check_post_lock. The following redirects the …

How to rewrite URI of custom post type in WordPress?

Posted by Prem Tiwari | Updated on | in WordPress, WordPress Core.


In this post, I will share how to rewrite URI of custom post type in WordPress. This is what I use to rewrite custom post type URLs with the post ID. You need a rewrite …

PHP ltrim() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


This function returns a string with whitespace stripped from the beginning of str. Without the second parameter, ltrim() will strip these characters: Syntax: Example #1 Usage example of ltrim()

PHP rtrim() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


This function returns a string with whitespace (or other characters) stripped from the end of str. Without the second parameter, rtrim() will strip these characters: Example #1 Usage example of rtrim() Output:

PHP trim() Function

Posted by Prem Tiwari | Updated on | in PHP Documentation.


This function returns a string with whitespace stripped from the beginning and end of str. Without the second parameter, trim() will strip these characters: Another example: Remove newlines (\n) from both sides of the string:

How to retrieve the value of a text field in flutter

Posted by Andre Scott | Updated on | in Flutter.


In this article, you will learn How to retrieve the value of a text field in flutter which a user has entered into a text field: After supplying the TextEditingController to the text field, begin …

How to add item to media library from blob or dataUrl?

Posted by Prem Tiwari | Updated on | in WordPress.


There is no direct way to pass pure binary data to the WP upload object. Only File based objects will be processed. I had to create a separate XmlHttpRequest. (Simply using $.ajax() did not work …

Build a form with validation in flutter

Posted by Andre Scott | Updated on | in Flutter.


Apps often require users to enter information into a text field. For example, you might require users to log in with an email address and password combination. To make apps secure and easy to use, …

How to create and style a text field in flutter

Posted by Andre Scott | Updated on | in Flutter.


Text fields allow users to type text into an app. They are used to build forms, send messages, create search experiences, and more. In this recipe, explore how to create and style text fields. Flutter …

Rest API Interview Question and Answers


List of the Most Popular Rest API Interview Question and Answers with Example. Here are the most Frequently asked basic and advanced Rest API interview questions and answers. A list of basic, as well as advanced …

Best MySQL Interview Questions And Answers


List of the Most Popular MySQL Interview Questions with Example Queries. Here are the most Frequently asked basic and advanced MySQL interview questions and answers. A list of basic, as well as advanced level MySQL questions …

Laravel Interview Questions and Answers


Below are the lists of most frequently asked Laravel Interview Questions and answer for freshers as well as experienced candidates to get the right job. What do you mean by bundles? Explain important directories used in …