“Find odd even number ” is the basic PHP program for a PHP learner. As you all aware, Odd numbers are not divisible by 2 and Even numbers are divisible by 2. Example : Odd number: 3, 5, 7, 9,11 Even number: 2, 4, 6, 8, 10 So here I am gonna explain it with a simple PHP program. Odd Even Number Program :- <?php $number=22; if($number%2==0) { echo “22 is an even number”; } else { echo “22 is not odd number”; } ?> Output…
Author: phpmypassion
Swap Two Number Program In PHP
Swap two number generally is the process of interchange two variables with each other. Just suppose you have X whose value 10 there is another number Y with value of 20. Now if we swap these two number with each other then the X value will change to 20 and Y value will change to 10. So here I am gonna explain with a simple PHP program. Swap Two Number Program :- <?php $x=10; $y=20; echo “Value of x: $x</br>”; echo “Value of y: $y</br>”; $temp=$x; $x=$y; $y=$temp; echo “Value of x:…
Armstrong Number Program in PHP
“Armstrong Number Program” is the initial program from where most of the beginner developers will start to learn and write code in any language. An Armstrong number is a number that is the sum of its own digits each raised to the power of the number of digits is equal to the number itself. Here is an example of check a armstrong number in PHP. Armstrong Number Program :- Below is the simple PHP program to check a number armstrong. <?php $number=153; $sum=0; $temp=$number; while($temp!=0) { $reminder=$temp%10; $sum=$sum+$reminder*$reminder*$reminder; $temp=$temp/10; } if($number==$sum) { echo “It…
Process to Install Docker on Ubuntu 16.04
Docker :- Docker is a container management service. The keywords of Docker are develop, ship and run anywhere. The whole idea of Docker is for developers to easily develop applications, ship them into containers which can then be deployed at anyplace. Docker has two flavors : Community Edition (CE) Enterprise Edition (EE) So if you don’t know which one should be install, just pick up The Community Edition (CE) flavor and install as below Docker Installation :- Follow the step by step process – Step#1 :- Set up the docker repository $ sudo…
What is Docker and Why We Use ?
What is docker ? Docker is a container management service. The keywords of Docker are develop, ship and run anywhere. The whole idea of Docker is for developers to easily develop applications, ship them into containers which can then be deployed at anyplace. Docker has two flavors : The Community Edition (CE) and the Enterprise Edition (EE) Initial Release : March 2013 Mostly use on agile based project. Reference Why docker ? Docker has the ability to reduce the size of development by providing a smaller footprint of the operating system via containers.…
How To Set Custom Variables With DataLayer in GoogleTag manager (GTM) ?
The most common challenge with Google Tag Manager (GTM) is setting up custom variables with dataLayer and making them dynamic for your JavaScript tag. In this article, I will explain the process for setting up custom variables for your custom JavaScript tag. I have previously covered an overview of GTM in another article. You can read it here. Setting Up Custom Variables With dataLayer To set up custom variables with dataLayer, developers need to pass the variables from their code. For example, suppose your JavaScript SDK requires data such as…
Top CSS Interview Questions And Answers for Freshers.
Here I am sharing most asked CSS interview questions and their answers for beginners. This list of CSS interview answers surly helpful for CSS beginners or web designers who just want to began their profession as a web designer. I recommend read out these interview questions before the interview. Question #1 – What is CSS? CSS stands for Cascading Style Sheet. It is a popular styling language that is used with HTML to design web pages. Question #2 – What is the latest version of CSS? As of now CSS latest…
How To Work With Google Tag Manager (GTM) ?
Many developers struggle with adding tags, snippets, pixels, or scripts to their websites to track events, remarketing, conversions, analytics, and more. Google Tag Manager (GTM) was introduced to address this issue, enabling users to add or update tags without developer assistance. Google Tag Manager (GTM) provides full control over how tags are defined and when they fire. It’s easy to learn and manage once you understand the basics. If you’re an SEO managing tracking codes for multiple clients, now is the perfect time to start using GTM. More In-Depth GTM…
How to Create a Scroll To Top With Some Delay Using JavaScript ?
Here I am sharing the code for scrolling a page from bottom to top with some delay. You can also use that to reach or show first error element box in your specified form. Show First Scrolled Error Element Box on Submit :- you can use below jQuery code to scroll on the first error element box on submit – $(‘html, body’).animate({ scrollTop: $(validator.errorList[0].element).offset().top-300 }, 2000); Above code will work for the form group on submit. for an example below – $(“#submit”).on(‘click’, function () { var validator = $(“#form”).validate({ rules:…
How To Get Current Route Name Path in Laravel 5.4 ?
Here I am going to share you problem that most of the laravel beginner found when developed a project with laravel. You can get to know about the solution for the issue ‘get current route name path in laravel 5.4’ with this article. Get Current Route Name Path From view (blade template) – You can get the current route name path from view (blade template) by using below code – {{ url()->current() }} // It will return route name with url {{ Request::path() }} // It will return only route…
