Bootstrap Datepicker Start and End date Validation

You can easily enable date selection to the form element using Bootstrap datepicker if you are already using Bootstrap on your page.

You need to add an external Bootstrap datepicker library.

This allows the users to select any date from the datepicker and they are not restricted.

In this tutorial, I show how you can validate Bootstrap datepicker start and end date in Bootstrap 5.

Bootstrap Datepicker Start and End date Validation

Read more

Remove Duplicate values from an Array in PHP

The array_unique() method is used to remove repeated or duplicate values from the array and return an array.

It is better to use this method on the array if there is some possibility of the same values or the later code in the program depends on it for example – selecting records based on ids and displaying them on the screen.

In this tutorial, I show how you can remove duplicate values from –

  • An Indexed,
  • Associative array and
  • Remove index by key name in the associative array.

Remove Duplicate values from an Array in PHP

Read more

Add Browse Button and Upload File in TinyMCE

In TinyMCE editor to view image and media options in the menu or in toolbar need to load them by using plugins option while initializing.

This adds them to the editor but you can load external file by passing the source path. It does not allow to browse any file within the system.

The browse button easily added by defining file_picker_callback option.

This only adds browse button but not allow file selection.

Within the file_picker_callback function need to write the script to enable file selection and upload the file to the server.

For upload the file to the server I am using PHP.

Add Browse Button and Upload File in TinyMCE

Read more