Create new Small Array from Big Array (Array Push method)

Hiiiii, if you are a php developer than sometimes you encounter a problem of making a small array out of large array on some conditions basis or you want to insert some elements into the array. PHP is having many easy method to do the above defined work.You can insert the elements in array in various conditional statements like for loop, foreach loop , while loop etc. In this example I’ll be showing two array insertion method in two different loops.

 

To see code……  CLICK HERE

Using Curl to contact various APIs in PHP

Hiiiii, being a developer if you want to contact or request APIs or you have to request payment gateway for sending the amount deduction request to payment sites then you can contact them with the help of form submissions or using web services . Most of us don’t know how to use web services and to use which web services for your work. so, here in this post I’ll give a tutorial of using a web services.

Web services are used for connection between two areas of data(sites) over network. For this tutorial, I will be using “curl” web services to connect to various APIs. Curl uses HTML, javascript and high level languages like “PHP”,etc to perform its task of connection between various sites. Using curl we can send a data in the form of XML or any other format which your requesting APIs demands.

curl-web-service

To see code……  CLICK HERE

PHP array print method in proper format

Hiiiii, If you are a PHP Developer then you generally face a situation when you want to echo a complete array in the complete array format with indexes in the complete proper format. You get this array echo problem when you post the form variables on next page or on same page, when you fetch the records from database or when you the variables in URL.

 

To see code……  CLICK HERE

Generate random Passwords in PHP

Hiiii, when we make some user registration system in our project or code then we always want to keep the user details like password etc very secure which is not easy to detect and which is random for each and every user. You can try to make random password by applying some logic but here in this demo I’ll be providing you with a very simple and short code to generate a random password.

This random passwords are also necessary when you have to send a confirmation mail to users with some password different from their identities. Users have to change their random passwords to their own password on first login.

Don’t interpret the meaning of these random password with passwords generated by some encryption techniques like md5 hash, etc. The random passwords here are generated in php by making a string with some logic by adding a digit to that password string.

In this technique which I’ll be showing here, you can generate the password of your desired length.

 

 

 

To see code……  CLICK HERE

FIle Handling in PHP (File Reading and Writing)

Hiiiii, we always find it difficult to work with files in our early stages of programming in any language. But sometimes it is necessary to work with files when it comes to reading and writing text files, doc files or html files. So, in this tutorial I am providing you a very simple code for file handling. It is easy to understand and execute. I have tested this code with text files and html files but you can try it with different format files also like doc, etc.

FIle Handling in PHP

To see code……  CLICK HERE

Changes to be made in Xampp/Wamp/Lamp Server to use PHP MAILER CLASS

Hiiiiii, There are some changes need to be made in the php.ini of your Xampp/Wamp/Lamp  Server to use PHP MAILER CLASS to send mails from your LOCALHOST. PHP mailer class allows you to send mails from your local machine. To send mails ,PHp mailer class requires some extensions like soap, ssl, sockets but these are commented in php.ini file so,we just have to uncomment those extensions.

 

PHP mailer class

 

 

To see code……  CLICK HERE

Using PHP Mailer Class to send mails from Localhost (Without making you website Live)

Hiiiiii, We all know that its common practice to send mails in our PHP website and you can perform this mail sending task by PHP  mail() function , but the problem with this function is that it works only when you site is live and you have put your website on some web server. But what when you have to test mail sending your localhost in your local machine at the time of developing. You can solve this problem by using PHP mailer class in your website to send mails from your local host .

To use PHP mailer class in your code , you have to made some changes in php.in to make PHP mailer class work and to see the changes, CLICK HERE .

 

PHP mailer class

 

 

 

To see code……  CLICK HERE

PHP Array to String and String to Array Conversion

Hiiii, we all know that a developer always need a functionality to change the array to string and string to array. We can write a code for this in any language with the help of some loops. But PHP offers two most important functions namely implode() and explode() for array to string and string to array respectively.

So, in this post I will show you the functionality of both of these functions.

PHP Array to String and String to Array Conversion

To see code……  CLICK HERE

Sending mail with PHP mail() Function

Hiiiiiii, we all at sometimes need a mail sending functionality in our PHP code . For this PHP community has given a very useful function to send a mail within your php code. This mail sending function name is mail() function and this function is very easy to use with no extra unusual parameters.So, in this tutorial , I’ll be giving tutorial of how to use mail function.

PHP mail() Function

 

 

To get code……  CLICK HERE

USING LINKEDIN API TO FETCH RECORDS (FULL PROFILE, CONNECTIONS, ETC) ~ MyCodeStock

Hiii, You all know that to allow the user to connect on Linkedin, Facebook or Gmail, etc on your site, you require an API. So,here in this post I will teach you how to connect and fetch the data from any Linkedin account with the help of linkedin API. This functionality is required to add a “Connect To Linkedin” button on your site to directly make the user visiting your site to directly connect to linkedin .

Through this tutorial, you can fetch connections, profile details, job updates, etc from Linkedin profile after login. In this tutorial I am fetching the full profile details of the person who is logging in but you can fetch details according to your needs by changing scope details from “r_fullprofile” to any other like “r_network”. Information about scope is present on Linkedin Developer site

To run this tutorial firstly you need an API KEY and Secret API , which you can get very easily by registering your site/application to linkedin.

To see code……  CLICK HERE