Blog Detail

thephpcode

thephpcode

http://thephpcode.blogspot.com/

thephpcode php code resource for all where we have code examples, cool techniques, tricks and sales of codes.

subscribe Recent Posts

  • Issues with multiple requests on PHP

    Posted on Wednesday November 25th, 2009 at 02:29 in session, request

    Again today I was answering questions on StackOverflow when I came across the question about not being able to load pages when downloading/loading large files.If you are using session, I suggest you use session_write_close() before you output the fil...

  • Getting value from an object (or instance of a class) in PHP 5

    Posted on Sunday November 1st, 2009 at 20:02

    Just earlier on I was working on the String class in the Samstyle PHP Framework. I was glad that I read the PHP manual and found this magical method in PHP5 OOP called __toString().Using __toString(), you can actually return a value for the object/in...

  • jQuery-like chaining in PHP\'s Object Oriented Programming

    Posted on Friday October 30th, 2009 at 11:14 in php, javascript, oop, class, chain, jquery

    It's interesting to see how object methods in PHP can be chained just like jQuery's chaining. jQuery's chaining:$("div").children(".firstbtn").hide().fadeIn();In PHP, it is also possible to chain similarly. Using the string class from Samstyle PHP Fr...

  • file_get_contents() vs fread() - Speed Test and Benchmarking

    Posted on Sunday October 11th, 2009 at 21:50 in php, speed, code, data, files, functions, optimize

    File access is commonly found in any PHP application. Be it caching, or reading data from a file or what. Lately I've been wondering, whether the use of file_get_contents() over fread() is a good practice (i always prefer file_get_contents()).So this...

  • Using Bit Shifting to Divide / Multiply

    Posted on Saturday October 10th, 2009 at 04:25 in php, code, optimize, bits

    To think of it, I rarely use bitwise operators in my coding - especially with all the convenience of other operators (can you imagine calculating bits whole day?).But seriously when I was reading on Bitwise operators, I realised that ($n / 2) == ($n ...

  • Pre vs Post Increment in PHP

    Posted on Saturday October 10th, 2009 at 04:14 in php, code, optimize, loop, iteration

    Earlier on I was browsing Google Code, and I chanced upon JSpeed - a javascript optimizer. I saw that they actually change post increments to pre-increments. I wondered why and thought I could ask this on Stack Overflow.One theory came up to be "prei...

Comments & Reviews

There is no rating for this blog because there are no comments yet.

Post A Comment/Review

* Your IP is being logged.
* Your e-mail address is used only for verification purposes only and will not be sold, or shown publicly.
* No HTML tags allowed
* DO NOT use the Comments/Reviews to promote your own site.

Name: or Login
E-mail:
Rating:
Verify: Spam Protection: sum of 2 + 1
Comment:
  Remember Information