Codxplore.com

Latest news:

Sahih al-Bukhari (সহীহ বুখারী) is a free Hadith application for android. This application is advertisement free. Download now https://play.google.com/store/apps/details?id=com.akramhossin.bukharisharif

820
Views
Hacker Rank: Day 3: Intro to Conditional Statements Solution in PHP

Hacker Rank: Day 3: Intro to Conditional Statements Solution in PHP

Task: Given an integer,perform the following conditional actions: If n is odd, print Weird If n is even and in the inclusive range of 2 to 5, print Not Weird If n is even and in the inclusive range of 6 to 20, print Weird If n is even and greater than 20, print Not Weird Input Format: A single line containing a positive integer, n. Constraints: 1 0 && $i =2 && $i =6 && $i 20){   
870
Views
Yii2 ccavenue payment gateway integration.

Yii2 ccavenue payment gateway integration.

In this blog post, i will try to explain how to integrate ccavenue payment gateway in Yii2. ccavenue  is one of India's leading digital payments and e-commerce solutions provider.  They provide extensive suite of web services to extend digital payment solutions. Before getting started with implementation you need to clone or download my github repository https://github.com/akramrana/yii2-ccav
788
Views
Hacker Rank: Day 2: Operators Solution in PHP

Hacker Rank: Day 2: Operators Solution in PHP

Task: Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip),  and tax percent (the percentage of the meal price being added as tax) for a meal,  find and print the meal's total cost. Round the result to the nearest integer. Example: meal cost = 100 tip percent = 15 tax percent = 8 A tip of 15% * 100 = 15, and the taxes are 8% * 100
845
Views
Install Smart App Banner Yii2 without jQuery

Install Smart App Banner Yii2 without jQuery

Smart app banner is an important element which is used to motivate user to download mobile application instead of using the website. The usage of a smart banner is only to promote app.To implement smart banner in Yii2 web application we need to do the following Download the javascript library from github using this https://github.com/kudago/smart-app-banner  as .zip format Put smart app bann
1457
Views
Hacker Rank: Day 1: Data Types Solution in PHP

Hacker Rank: Day 1: Data Types Solution in PHP

Task: Declare 3 variables: one of type int, one of type double, and one of type String.  Read 3 lines of input from stdin (according to the sequence given in the Input Format section below) and initialize your 3 variables.  Use the + operator to perform the following operations:  Print the sum of i plus your int variable on a new line. Print the sum of d plus your double variable to a
775
Views
Hacker Rank: Day 0: Hello, World Solution in PHP

Hacker Rank: Day 0: Hello, World Solution in PHP

Task: To complete this challenge, you must save a line of input from stdin to a variable, print Hello, World. on a single line, and finally print the value of your variable on a second line. Input Format: A single line of text denoting inputString (the variable whose contents must be printed). Output Format: Print Hello, World. on the first line, and the contents of inputString on the second
2855
Views
Usages of PHP date, strtotime and mktime functions

Usages of PHP date, strtotime and mktime functions

To customize date and time PHP provides us some important functions such date, strtotime and mktime. In this post i will demonstrate some usages for these functions. Example 1: Get year start and end date for the current year we can use $yearStart = date("Y-m-d", strtotime('this year January 1st')); $yearEnd = date("Y-m-d", strtotime("this year December 31st")); Example 2: Get month start a
3471
Views
php export csv utf 8

php export csv utf 8

While generating a CSV using PHP sometimes we stumbled upon one common problem  where any special character like £ becomes ASCII in generated CSV file,  the reason behind this is the encoding of generated CSV is wrong and  we need to output CSV in UTF8 format, so we will be able to use special ASCII characters in CSV file. Using example below we can encode UTF8 generated CSV file,  We ne
2666
Views
Yii2 Scenarios validate only create Action

Yii2 Scenarios validate only create Action

Yii2 model scenarios can be used differently. Lets say, we have a model as Customer Which can be used to store customer sign-in inputs, but it can be also used for the customer sign-up purpose. In different scenarios, Yii2 model can be used in multiple business rules and logic.the email attribute may be required during customer sign-up, but not required customer sign-in. Yii2 model uses the y
2985
Views
 Yii2 - Get Current Action ID in main.php

Yii2 - Get Current Action ID in main.php

Yii2 web application project, sometimes we need to current controller ID, action ID. Specially when we need role based access control, we need to check the controller ID as well as action ID. Using Yii2 view context api we can get these data. for example if we need controller ID we can use below code $controller = $this->context->action->controller->id; if we need action ID only we can use as
3147
Views
Yii2 pagination

Yii2 pagination

Today we will discuss how to implement pagination to any Yii2 web application. The pagination represents information relevant to pagination of data items fetch from any data sources. When we need data to be rendered in multiple pages,this can be used to display information such as total item count, page size, current page. Pagination implementation has two steps. Fetch data from data source
2499
Views
Yii2 joinWith(), innerJoinWith(), join(), leftJoin()

Yii2 joinWith(), innerJoinWith(), join(), leftJoin()

Yii2 active record has powerful built-in feature to join database table. In this post we will learn some of the useful features joinWith() innerJoinWith(), join() leftJoin() join using query builder Example of joinWith(): $model = Users::find()                ->joinWith('posts', false, 'INNER JOIN')                ->all(); Example of innerJoinWith(): $mod

Subscribe Us


Follow Us