New to our community ?

Discover a world of possibilities! Join us and explore a vibrant community where ideas flourish and connections thrive.

One of Our Valued Members

Thank you for being part of our community. Your presence enriches our shared experiences. Let's continue this journey together!

Home Blog Page 5

How to extract all URL from website in PHP

0

Welcome to another PHP tutorial post. in our previous post we learn how to Get Domain Name from URL in PHP
today in this post we will learn how to extract all URL from a website with the help of predefined PHP functions like file_get_contents.

extract all url using php

so before start to fetching all URL of a website or a webpage we will take an short overview of DOMDocument.

What is DOMDocument in PHP

The PHP DOMDocument library allows us to manage HTML and XML pages after uploading our script in new DOMDocument.
so basically it is a best option to reading and changing into a HTML and XML files with the help of DOM library.

file_get_contents for reading

as we all know that file_get_contents is a predefined PHP functions which is helpful for read a content of a file into a string format.
So first of all we are creating a variable with the name of $html which will store all the string values which will converted by file_get_contents functions of PHP.

after putting the values in $html variable we are simple create a new DOM document which will Parse the HTML. The @ is used to suppress any parsing errors, that will be thrown if the $html string isn’t valid HTML.

by using DOMDocument PHP function getElementsByTagName() we will get a new instance of class DOMNodeList which contains all the elements of local tag name.
so we are passing anchor tag in side getElementsByTagName().

so in the below code we are putting our URL to fetch all the links which are inside the anchor (a) tag.

<?php 
$html = file_get_contents('http://Shortlearner.com');
$dom = new DOMDocument;
@$dom->loadHTML($html);

$links = $dom->getElementsByTagName('a');
foreach ($links as $link){
    echo $link->getAttribute('href'), '<br>';
}
?>

Also Read
How to Install PHP on CentOS.

How to Send Attachment on mail using PHP.

PHP Login Script With Remember me.
Unable to create a directory a wordpress error

How to integrate Razorpay Payment Gateway using PHP.
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript

Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

How to install CMake on CentOS 8

0

Welcome back to another tutorial of CentOS. In our previous CentOS tutorial we learn how to install google chrome in CentOS.
Today in this post we will see how to install CMake On CentOS.

before start this tutorial we will take a short overview of CMake and CentOS.

CMake installation on CentOS

What is CMake.?

so basically CMake is a free, opensource and cross-platform family of tools designed to build, test and package the software.
It is developed by Kitware for a powerful, cross-platform build environment for open-source projects. 

Before Installation

Before start to install the CMake on our Linux machine. we must have the non-root user account on our desktop with sudo privileges.
so just follow the below steps for easy installation.

Install Latest Version of CMake CentOS

So before installing CMake we need to download its package first, and the reason behind is that because the CentOS Global Repository  does not provide us a latest version of CMake.
so no need to worry about it we will download our latest CMake package manually.

download CMake latest version

so just follow the below steps to download the latest version of CMake.
first we open the terminal by pressing ctr+alt+t in our CentOS machine.
for downloading latest package copy the below command and run it on terminal.

wget https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz

after running the above command the latest package will be downloaded in .tar format. so we are extracting this package by using tar command.

tar -zxvf cmake-3.15.2.tar.gz

after extracting our CMake package we will navigate it by using cd command.

cd cmake-3.15.2

Now we are running bootstrap file by following command.

./bootstrap

After running the bootstrap command we need to Run make command

make

Now we will install CMake by below command.

sudo make install

Confirm installation and check version

Now confirm the installation and check the version by using below command.

cmake --version

So finally we learn how to install CMake in our CentOS machine. if this tutorial helps you than please support us and sharing this tutorial with your developer buddies.

How to Install google chrome web browser on CentOS

0

Welcome back to another tutorial of CentOS. in our previous post we learn how to install XAMPP in CentOS.
today in this CentOS tutorial we will learn how to install google chrome web browser on CentOS.
so before start this tutorial lets take an short overview regarding google chrome.

install google chrome on centos

Why Google Chrome

As we all know Google Chrome is developed by Google. Google Chrome is one of the most powerful, safest, fastest and most popular web browser in the world.
Google Chrome is not the opensource browser itself, but it is based on the Chromium browser which is also available for CentOS. It is a secure and easy to use browser.

Install Google Chrome

Before start to install the google chrome on our Linux machine. we must have the non-root user account on our desktop with sudo privileges.
so just follow the below steps for easy installation.

Step 1: Download the .rpm package of Google Chrome

so just copy the below command and run it on your terminal to download the .rpm package.

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

Step 2: Installation Process

so after download the .rpm package , will need to have sudo privileges. To install Google Chrome use the below command.

sudo yum localinstall google-chrome-stable_current_x86_64.rpm

after running this command on your terminal it will ask for your password. so just enter the password of your system and continue.

Step 3: Start Chrome

after successfully installation of chrome , there are two way to start google chrome. first one is the universal way, go to the applications, select internet and click on the google chrome.
the another way is go to the terminal and run the below command.

google-chrome

Upgrade Google Chrome

so if you want to upgrade your google chrome version just copy the below command and simply run it on your terminal section.

sudo yum update google-chrome-stable

So finally we learn how to install google chrome in our CentOS machine. if this tutorial helps you than please support us and sharing this tutorial with your developer buddies.

How to Install xampp in Linux CentOS7

0

Welcome back to another tutorial of CentOS.In our previous post we learn how to install Apache Web Server on CentOS 7.
today in this post we learn How to Install xampp in Linux CentOS7.
before start this CentOS tutorial we should take an overview of XAMPP.

xampp installtion in centos

What is XAMPP.?

so basically XAMPP is a local web server which is majorly used by developers to run their program on local machine.
it was developed by Apache friends and it is available on 11 different languages.

Full form of XAMPP

XAMPP is a local web server which are widely used by developer community to test their programs on local machine.
so the full form of XAMPP is
X- Cross platform
A- Apache
M- MySQL
P- PHP
P- Perl

Before start to install XAMPP on our linux machine. we must have the non-root user account on our desktop with sudo privileges.

Install XAMPP

so before installing XAMPP we need to download the latest package of XAMPP.
To download XAMPP run the below command in the terminal using wget command

sudo wget https://downloadsapachefriends.global.ssl.fastly.net/7.3.0/xampp-linux-x64-7.3.0-0-installer.run?from_af=true

Now we will give the permission to the downloaded file to make it executable by following command.

sudo chmod +x xampp-linux-x64-7.3.0-0-installer.run

After setting up the permission run the file using the below command

sudo ./xampp-linux-x64-7.3.0-0-installer.run

after hitting the above commands we will giving some permission to XAMPP . just follow the below images for better understanding.

xampp set up on centos

Click on the next button.
Now it will ask us to select components to install, it is recommended to leave it as default and just hit on the Next button.

xampp components

In the next step it will be informed of the location where the XAMPP setup is going to be installed so simply just click on the next button again.

xampp location in linux

Now  it will ask us to install sponsored applications such as Drupal, Joomla, and WordPress so just click on the next button.

install wordpress in xampp

now the installation process is starts.

xampp installation process

after end of installing process just click on the finish button to launch.

launch xampp

Start and verify Xampp

After the installation we are just run a simple command to verify the xampp installtion so just copy the below command and run it on your terminal.

$ sudo /opt/lampp/lampp start

Now go to the browser and search http://localhost to see the output of XAMPP.

Uninstall XAMPP

So if you want to uninstall this setup just copy the below commands and run it on your terminal.

cd /opt/lampp

Now unstall XAMPP by following command.

./uninstall

Now you will be prompted to confirm uninstalling XAMPP. simple Click on yes to uninstall XAMPP .
After completing the Uninstallation process run following command to remove /opt/lampp directory

sudo rm -r /opt/lampp

Conclusion

so finally we learn how to perform installation the XAMPP on our CentOS platform.
if you have any query please ask and if this article helps you than please share it with your developer buddies.

How to Generate Firebase Server Key

0

Welcome back to shortlearenr.com, in our previous post we learn how to implement Razorpay Payment gateway with the help of PHP.
today in this post we will see how to Generate Firebase Server Key.
so before start this tutorial we will take an short overview about firebase and its uses.

FCM push notification for android

What is Firebase

so basically Firebase is a tool which is developed by google, to building app infrastructure and improving app quality for growing your business.

so Firebase server key is used to send push notifications to android devices and this server API key is used to identify Firebase application.
we are generating Firebase server key in the below steps, keep follow the steps

Create a Firebase project and Get your Server Key

Step1 : In the very first step we have to log in into Firebase Developer Console. if you still not created any project simply click on Create project.

firebase server key

Step2 : Enter your project name, accept the Firebase terms and conditions and hit the CREATE PROJECT button.

firebase development

Also Read
How to Install PHP on CentOS.
Unable to create a directory a wordpress error
How to Send Attachment on mail using PHP.
PHP Login Script With Remember me.
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript

How to integrate Razorpay Payment Gateway using PHP.
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

Step3 : In the third step we select Not right now option because we will setup our google analytics later and hit create project button.

firebase cloud messaging for android and php

Step4 : After hitting the create project button we will get a message Your new project is ready, press the Continue button to redirect your project dashboard page.

firebase cloud integration using php

Step5 : On the dashboard page click on the Gear icon which is in the top left and select Project settings.

FCM integration in php

Step6 : In the last step we just click on the Cloud Messaging Section and we will have the Server Key.

get FCM server key

thanks for reading, if this article helps you please support us and share with your developer buddies.