Saving a curl response into a php variable

php-mysql

Saving a curl response into a php variable Here is example to save a curl resonse into a variable in php <?php //URL of targeted site $url = “http://www.putyourapihere.com/”; $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // grab URL and pass it to … Read more

get the last 7 characters of a PHP string

php-mysql

get the last 7 characters of a PHP string Use substr() with a negative number for the 2nd argument. $newstring = substr($dynamicstring, -7); string substr ( string $string , int $start [, int $length ] ) If start is negative, the returned string will start at the start’th character from the end of string Example: <?php echo … Read more

PHP – MySQL : Create Database

php-mysql

  [root@mysqlDB]# mysqladmin -u root -p create eduguru Enter password:****** This will create a MySQL database eduguru. This is a simple example to create database called eduguru. Example: <?php $dbhost = ‘localhost:3036’; //If mysql server is on same server $dbuser = ‘root’; //mysql user who has the permission to create database $dbpass = ‘rootpassword’; //mysql user’s password … Read more

Eduguru : Online Tutorial

Eduguru is Online Web tutorial aiming to support and provide the easiest way to learn computer and programming language and make them aware about new technologies. EduGuru.in is also a web developer information website, with tutorials and references relating to web development topics such as HTML, CSS, JavaScript, PHP, and SQL. http://EduGuru.in