Blog Archives

you can learn here basics about Php.

How to enable PHP cURL in windows

PHP has build-in extension for getting content from remote sites. This extension is known as cURL. For enabling cURL in windows environment, we need to do below two steps. -Uncomment extension=php_curl.dll in the PHP.INI file. -Copy the below two dll

Posted in Php Tagged with:

PHP cURL and its uses

cURL which  plays an important role in automating the tasks involving interaction between many web sites. cURL (Client for URLs) is free and open software that compiles and runs under a wide variety of operating systems. It is available as 

Posted in Php Tagged with:

Code for getting WordPress logged user from external php file

We have used a Session variable for getting the WordPress logged in user id from an external php file. But it didn’t work once after upgrading the wordpress. Obviously the session variable setting page was overwritten by new wordpress update.

Posted in Php Tagged with:

PHP string captialization

Php has 3 primary captialization function strtoupper strtolower ucwords Converting the String to upper case- strtoupper() strtoupper () converts the string to upper case string For eg: OUTPUT: oldstring: hello newstring: HELLO Converting the String to lower case- strtolower() strtolower()

Posted in Php Tagged with: ,

PHP die()

Basically error handling is very simple in php. While writing the code for your applications  you might struggle to find out the errors . In  that case you can use die() to handle errors. Let us consider the following example:

Posted in Php Tagged with: ,

gettype() in php

Like other programming languages, php does not requires any  variable declaration so we can move freely with php datatypes. To view the datatype of the variable  use  gettype() function Eg1: OUTPUT 1: Name:HELLO Datatype:string Eg 2: OUTPUT 2 : Value:25

Posted in Php Tagged with: ,

Generating a captcha code using PHP

This script generates images (known as “Captcha’s”) which contain security codes used for protecting a form from spam bots. By encoding a ‘password’ inside an image and asking the user to re-enter what they see you can verify the user

Posted in Php Tagged with: ,

print_r() Versus var_dump()

There are many functions available in PHP to debug a variable. This function can be used to store value in an array or other another object and it is important to troubleshoot the codes. Let us see some of them

Posted in Php Tagged with: , ,

Page Redirection in php

When we want to move from one page to another we have to use page redirection here is a php code that deals with page redirection .Page redirection can be done in php page .sing header() which is used to

Posted in Php

Using Associative array

When we use Curl option to post some values .We might face some issue where the data posted will not be posted in the web page .Here is a scenario when we got this same kind of issue and that

Posted in Php Tagged with: ,