Get Solved
  • Home
  • Web
  • Database
  • Desktop
  • Mobile
PHP Logo

How to output JSON using PHP

By Naveed On October 23, 2010 · 8 Comments

PHP (version 5 >= 5.2.0, PECL json >= 1.2.0) provides a method json_encode to convert array to string.

$sample = array( ‘name’=>’My Name’, ‘email’=>’my_email@example.com’ ); echo json_encode($sample);

Continue Reading →
PHP Logo

Why PHP ini_set() does not work with upload_max_filesize

By Naveed On August 21, 2009 · Leave a Comment

‘upload_max_filesize’ and ‘post_max_size’ are of type PHP_INI_PERDIR, which means “Entry can be set in php.ini, .htaccess or httpd.conf”. So you can’t set it in your script.

We can set PHP_INI_PERDIR settings in a .htaccess file with ‘php_flag’

Continue Reading →
PHP Logo

How can I get the name of the calling method in PHP

By Naveed On April 15, 2009 · Leave a Comment

I just fell in need of knowing the name of the method that is currently being called. After having a few minutes of unsuccessful searching i just thought of Late Static Binding and here the PHP Manual helped me.

Continue Reading →
PHP Logo

How to save cURL output to string

By Naveed On January 8, 2009 · 1 Comment

You can save the cURL output as a string for further manipulation.

Following code takes care of:

// create curl resource $ch = curl_init(); // set url curl_setopt($ch, CURLOPT_URL, "http://example.com"); // return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // save output to string $output = curl_exec($ch); // close curl resource to free up [...]

Continue Reading →
  • Ask questions
  • Categories

    • Database (3)
      • MySQL (3)
    • Desktop (3)
      • Linux (1)
      • Unix (2)
    • Mobile (2)
      • Android (2)
    • Web (13)
      • API (1)
      • Javascript (4)
      • PHP (4)
      • Product (2)
      • Python (1)
  • Tags

    Ad ADT Adword AJAX Android API balancing Binding Calling Class Column Configure Copy Curl Data Database Eclipse Error Gadget Google Hello ini ini_set Install Invite Javascript Late Linux Load Master Method MySQL Output PHP Playground Proxy Replication SeaMonkey Server Slave Static String Table Ubuntu upload_max_filesize

Get Solved

Pages

The Latest

  • How to use Event Delegation in jQuery to optimize User Interface
    Event Delegation and Event Bubbling are two important concepts in JavaScript. If […]

More

Thanks for dropping by! Feel free to join the discussion by leaving comments, and stay updated by subscribing to the RSS feed.
© 2011 Get Solved
Platform by PageLines