• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
logo

Tutsplanet

Free Technical and Blogging Resources

  • Home
  • Web Hosting
  • Programming
  • Plugins
  • Write For US
  • News
  • About Us
  • Tools

PHP

How to Force Download File from Remote Server in PHP

Dec 9, 2020 by Editorial Staff Leave a Comment

Usually we download the files hosted in same server using php, but in this tutorial we are showing how to download a file hosted in remote server.

Filed Under: PHP

How to get GMT date time in Magento 2?

Sep 23, 2020 by Editorial Staff Leave a Comment

Magento 2 usually saves the time in GMT in database, but display on admin or frontend will be based on the selected timezone. Use the below code to get the time with GMT timezone from Magento 2 code. Magento comes with DateTime php class, Magento\Framework\Stdlib\DateTime\DateTime is used for Forms GMT date. <?php public function __construct( […]

Filed Under: PHP Tagged With: Magento 2

How to create a Controller in Magento 2?

Sep 23, 2020 by Editorial Staff Leave a Comment

Controller is one of the most important thing in MVC Frameworks in general, so the same in Magento 2 as well. It’s very duty is to receive the request, process and render to user. In Magento 1 there was one controller and it accommodates all the CRUD routes or other relevant routes. But in Magento […]

Filed Under: PHP Tagged With: magento2

How To Get The Collection Of Records From A Custom Module In Magento 2?

Sep 23, 2020 by Editorial Staff Leave a Comment

If you are working on a custom Magento 2 module, and wondering how to get the collection of records from your custom database table, this article is for you. This is very common that your Magento 2 website needs more database tables than what Magento shipped with. So in a listing page such as blog […]

Filed Under: PHP Tagged With: Magento 2

Removing whitespace characters in PHP

Sep 22, 2020 by Editorial Staff Leave a Comment

Today’s guide we are talking about the white spaces in strings and how to remove white spaces in PHP. The normal way to remove white space is using str_replace. Remove whitespaces using str_replace str_replace is very simple and powerful for removing whitespaces. Use the below script to see this in action. <?php $str = “he […]

Filed Under: PHP, Programming

Disable versions in Magento 2

Aug 30, 2020 by Editorial Staff Leave a Comment

By default Magento 2 static urls have a version string attached to it. For example, if you take the view source of the page, you will see urls contains the following string -version1490119662.

Filed Under: PHP Tagged With: Magento 2

Installing Composer on Mac OSX

Aug 24, 2020 by Editorial Staff Leave a Comment

Composer is a dependency management tool for php projects. By using composer, you can just declare the dependecy in your project and composer will handle/download this for you.

Filed Under: PHP Tagged With: osx

How To Create A Custom Taxonomy In WordPress

Aug 19, 2020 by Editorial Staff Leave a Comment

Today’s tutorial we are showing how to create a custom taxonomy in WordPress. After WordPress 3 this feature is included in the core, so we just need to use the function with some params. The core developers created function to handle the heavy lifting for us. Why Custom Taxonomies? As your system/website grows you feel […]

Filed Under: PHP, Programming Tagged With: Wordpress

Drag and Drop File Upload using DropzoneJS and PHP

Jul 25, 2020 by Editorial Staff Leave a Comment

Today’s article, we will show you how to drag and drop an image file using dropzonejs and PHP. Dropzonejs library provides us options for multiple uploads feature. For this we have one index.php, dropzone repo, and upload.php files. We use bootstrap css to help us to sort the stylesheets. Download the dropzonejs by clicking here […]

Filed Under: PHP Tagged With: dropzone.js

Using PHP glob() Function to Find Files in a Directory

May 20, 2020 by Editorial Staff Leave a Comment

It is very common that you may want to list out all the files in a directory that contains several levels of sub directories. So consider the below folder structure media sample.jpg foo.txt get.php PHP has a built in function called which comes handy while handling files and directories. Best thing about this function is […]

Filed Under: PHP

Hierarchical Tree view Category Example in Laravel

May 3, 2020 by Editorial Staff Leave a Comment

Most of the projects you work in PHP or in any language, there you have to encounter with categories and sub categories. When comes to categories, tree view is the best listing method that we can use in our web apps. In this article, we are showing  you how to  create Laravel tree view for […]

Filed Under: PHP, Programming Tagged With: Laravel

PHP str_replace() Function

Oct 22, 2019 by Editorial Staff Leave a Comment

replaces all occurrences of search string with a replacement string. Syntax str_replace(find, replace, string, count) find(required) – It specifies the value to find. replace(required) – It specifies the value to replace the value in find. string(required) – it specifies the string to be searched. count(optional) – it is the variable that counts the number of […]

Filed Under: PHP, Snippets List

How to Copy a File From One Folder to Another With PHP?

Oct 20, 2019 by Editorial Staff Leave a Comment

Today’s article, we will show you how to copy a file from folder to another by using PHP. For this we use default PHP function .  Basically, it has two parameters to work a copy function. This file will overwrite if the file already exists in the folder. See the below example function. <?php $file […]

Filed Under: PHP

Ajax Image Upload using PHP and jQuery

Oct 8, 2019 by Editorial Staff Leave a Comment

Today’s tutorial, we are showing uploading an image using ajax and saving into a folder in server. In the past, we have seen many tutorials that explains how to upload an image using html and PHP. This tutorial too use PHP to upload the image, but uses the asynchronous techniques of Javascript via jQuery. This […]

Filed Under: PHP

20+ Best Magento Website Templates Free & Premium

Jul 25, 2019 by Editorial Staff Leave a Comment

Ultimo – Fluid Responsive Magento Theme Demo Download/More Info Porto | Ultimate Responsive Magento Theme Demo Download/More Info Shopper – Magento Theme, Responsive & Retina Ready Demo Download/More Info Fortis – Responsive Magento Theme Demo Download/More Info Fastest Demo Download/More Info Market – Premium Responsive Magento 2 Demo Download/More Info Claue Demo Download/More Info Black&White Demo Download/More Info Everything | Multipurpose Responsive Magento […]

Filed Under: Magento, PHP Tagged With: Magento Themes

Magento 1: Assign/ Remove category from a product.

May 7, 2019 by Editorial Staff Leave a Comment

This tutorial will show how to assign or remove a category from a product in Magento 1. I have used the standalone script, but you can use this in any module. Assign a category to product $productId = 2000; $categoryId = 200; Mage::getSingleton(‘catalog/category_api’)->assignProduct($categoryId,$productId);   Remove a category to product $productId = 2000; $categoryId = 200; […]

Filed Under: PHP Tagged With: Magento

Magento1 – Remove existing Media Gallery and Add New One at same loop

Apr 15, 2019 by Editorial Staff Leave a Comment

Below script helps you to remove existing images from the media gallery and add a new one at the same time to avoid duplicates in Magento 1. The following script will be very helpful while importing images bulk to Magento website.

Filed Under: PHP Tagged With: Magento1

Laravel Auth: Login with username instead of Email

Apr 9, 2019 by Editorial Staff Leave a Comment

Setup Project Update the .env file with your desired database details. Run the following command to create the scaffold for authentication pages. Next, we want to add our new field, username to our database migration structure. Open this file database/migrations/create_users_table.php. Add the username field in the up() function after the name field. So the final […]

Filed Under: PHP Tagged With: Laravel

MySQL CONCAT() Function

Apr 2, 2019 by Editorial Staff Leave a Comment

If you want to join several strings together in MySQL you can use the CONCAT function. Syntax Example  

Filed Under: PHP

How to Convert PNG to JPG with compression in PHP?

Mar 27, 2019 by Editorial Staff Leave a Comment

Use the below snippet to Convert PNG to JPG with compression in PHP.

Filed Under: PHP

Laravel Image Intervention Tutorial With Example

Nov 5, 2018 by Editorial Staff Leave a Comment

How to use Intervention Image in Laravel 5 with Example. In this tutorial we will show how to use Intervention image manipulation package in Laravel. Basically we use this package to upload an image and resize it in the server. Common use cases are upload users photo or upload a product image etc. Laravel Image […]

Filed Under: PHP, Programming

How to get all days and date for a given month?

Aug 5, 2018 by Editorial Staff Leave a Comment

This is to get all days and date for choosen month. Just follow the code to display all the dates for a month. $month = “07”; $year = “2018”; $startDate = “01-“.$month.”-“.$year; $startTime = strtotime($startDate); $endTime = strtotime(“+1 month”, $startTime); for($i=$startTime; $i<$endTime; $i+=86400) { $list[] = date(‘Y-m-d-D’, $i); } print_r($list);

Filed Under: PHP, Programming, Snippets List

Get YouTube Video Thumbnail URL using PHP

May 2, 2018 by Editorial Staff

YouTube is the world’s favorite video search engine. It’s very common now people use YouTube video in their websites/blog. Today’s tutorial we are demonstrating how to fetch YouTube video thumbnail using PHP. Basically  this simple PHP script fetch  YouTube thumbnail image from a full YouTube video URL. Get Thumbnail Image URL from YouTube Embed Code […]

Filed Under: PHP

Sending emails through Mailgun using Codeigniter

Feb 18, 2018 by Editorial Staff Leave a Comment

This tutorial provides step by step guide to send email using mailgun SMTP using Codeigniter. Mailgun is a  powerful API that enables send,receive and track emails. Step #1 Let’s create a config.php file in the config/email.php and define $config array in it. You do not need to load this file manually, as the Codeigniter will […]

Filed Under: PHP Tagged With: Codeigniter

Basic Database Connection using PDO in PHP

Jan 7, 2018 by Editorial Staff Leave a Comment

In this tutorial we are going to learn  connecting to MySQL with PHP using PDO. “PDO – PHP Data Objects – is a database access layer providing a uniform method of access to multiple databases.” You don’t need to worry about different syntax for different database types, PDO will do this painless. # connect to […]

Filed Under: PHP

How to get Query Strings Value from a URL in Laravel 5.5?

Dec 19, 2017 by Editorial Staff Leave a Comment

When you work with Laravel it is very common to get query string values from URL. In native PHP you can get this via $_GET variable. But when you want to get Query strings from a URL in Laravel you can use the below methods. Either you can use Request Facade or Input facade in […]

Filed Under: General, PHP Tagged With: Laravel, Laravel 5.5

PHP GET and POST Method

Sep 22, 2017 by Editorial Staff Leave a Comment

When we are using html form, we can send data to another page using two different methods POST method GET method Both serves same purpose, but the internal mechanism is bit different. When using GET method key value pairs are passing through browser navigation bar. But for POST method a visitor cannot see the data […]

Filed Under: PHP

How to capture screenshot of website from URL in PHP

Sep 12, 2017 by Editorial Staff 3 Comments

You may have a requirement to show the website’ screenshot in certain pages. You can use some third-party paid services for that. But here we are demonstrating a free service, that too from Google. You can write your own script to get the screenshot from URL. Basically, Google PageSpeed Insights API is used to analyze […]

Filed Under: PHP Tagged With: Google API

CodeIgniter – Basic Concepts

Sep 7, 2017 by Editorial Staff 1 Comment

Codeigniter is a small footprint MVC framework that helps programmers to create robust web applications. It is considered as one of the smallest frameworks when coming to the size and learning curve. What are the basic concepts in codeigniter ? Controllers Controllers are the entry point in any web application. So controller does same duty […]

Filed Under: PHP Tagged With: Codeigniter Tutorials

Ways To Redirect URLs to Another web page

Aug 15, 2017 by Editorial Staff Leave a Comment

Different ways to redirect one page to another, this tutorial describes that. You can use different programming/scripting languages to achieve this. We can use server side programming language or client side scripting language like HTML, Javascript. Redirect using PHP   Redirect using HTML meta tag Redirect using Javascript timeout function

Filed Under: PHP

  • Go to page 1
  • Go to page 2
  • Go to Next Page »

Primary Sidebar




Quick Links

  • A Simple YouTube Video Downloader Script in PHP
  • The 50 Most Useful jQuery Plugins for Frontend Development
  • Word Set 01
  • Convert PNG to JPG Online

Subscribe

* indicates required

Share

   

Hot topics

  • A Simple YouTube Video Downloader Script in PHP 13.2k views
  • Open a URL in a new tab using JavaScript 10.6k views
  • Using Third-Party Libraries in Codeigniter 8.3k views
  • Add FTP/SFTP in Visual Studio Code 6k views
  • Manually Install APK Files In Android Studio Emulator 4.6k views
  • Replace “\n” with new line characters, using Notepad++ 4.6k views
  • Upload Multiple Images and Store in Database using PHP and MySQL. 4.4k views
  • How To Install And Use CKEditor In Laravel? 4.2k views
  • Simple PHP Shopping Cart 4k views
  • Spout, an awesome library for reading and writing in Excel. 3.3k views

Categories

  • Design & Development
  • Drupal
  • Facebook
  • General
  • How To
  • ios
  • Javascript
  • Linux
  • Magento
  • Marketing
  • News
  • PHP
  • Plugins
  • Programming
  • Snippets List
  • Social Media
  • Softwares
  • Themes
  • Tips
  • Wordpress
  • YouTube

Copyright © 2021 · TutsPlanet Gene Theme on Genesis Framework · Powered By BunnyCDN