January 17th, 2006
Having problem during coding, was thinking how to join an array after results returned from several database tables, then Sogua found a function for me call array_merge() in PHP. After studied PHP documentation and I have found PHP built-in a lot cool array functions such as array_reverse, array_flip, array_diff_assoc and etc. These array functions have helped me a lot on array() manipulations.
Let talk about array_merge, let say you have done few query from differrent database tables, and you want all the returned results store into an array, here is simple example.
Assume you have array as below;
$takizo = array("Company Name"=>"Takizo", "Company Tel"=>"1234", "Country"=>"Malaysia");
$paulooi = array(”DOB”=>”09091999″, “POB”=>”AS”, “web”=>”paulooi.com”, );
$food = array(”Chinese”=>”Bak Kut Teh”, “Indian”=>”Tosai”, “Malay”=>”Nasi Lemak”);
Those arrays above are query from different database tables(after runing few time pg_query), but you want to put all in one array, this will save you.
$paul_details = array_merge($takizo, $paulooi, $food);
print_r($paul_details);
It will returns,
Array
(
[Company Name] => Takizo
[Company Tel] => 1234
[Country] => Malaysia
[DOB] => 09091999
[POB] => AS
[web] => paulooi.com
[Chinese] => Bak Kut Teh
[Indian] => Tosai
[Malay] => Nasi Lemak
)
Hope this helps!
Posted in php | No Comments »
January 12th, 2006
The PHP development team is proud to announce the release of PHP 5.1.2.
This release combines small feature enhancements with a fair number of
bug fixes and addresses three security issues. All PHP 5 users are
encouraged to upgrade to this release.
The security issues resolved include the following:
* HTTP Response Splitting has been addressed in ext/session and in the
header() function. Header() can no longer be used to send multiple
response headers in a single call.
* Format string vulnerability in ext/mysqli.
* Possible cross-site scripting problems in certain error conditions.
The feature enhancements include the following notables:
* Hash extension was added to core and is now enabled by default. This
extension provides support for most common hashing algorithms without
reliance on 3rd party libraries.
* XMLWriter was added and enabled by default.
* New OCI8 extension that includes numerous fixes.
* PNG compression support added to the GD extension.
* Added –enable-gcov configure option to enable C-level code coverage.
* getNamespaces() and getDocNamespaces() methods added to SimpleXML
extension.
The release also includes over 85 bug fixes with a focus on:
* Correction of the many regressions in the strtotime() function.
* Fixes of several crashes, leaks and memory corruptions found in the
imap, pdo, gd, mysqli, mcrypt and soap extensions.
* Corrected problems with the usage of SSI and virtual() in the Apache2
SAPI.
* Build fixes for iconv and sybase_ct extensions.
* Fixed the previously broken Sun(rise|set) functions.
* SQLite libraries upgraded to 2.8.17 and 3.2.8
* Win32 binaries now include libxml2-2.6.22 and libxslt-1.1.15.
The full details of the changes in PHP 5.1.2 can be found here:
http://www.php.net/ChangeLog-5.php#5.1.2
PHP Development Team.
Posted in Technology, php | No Comments »
January 12th, 2006
MyOSS First 2006 meet up fall on 13th Jan 2006. Flying back to Alor Setar tomorrow afternoon, can’t attend the meet up and meet cool open source geeks. If you are free, drop by there and meet some open source folks, chills out with them.
Day/Time: 13th Jan 2006/7:00pm
Vanue: Byte Craft Sdn. Bhd, Mezzanine Floor, Bangunan Zikay, 53, Jalan Raja Alang, 50300, Kampung Baru, Kuala Lumpur, Malaysia. (Location map)
Agenda:
7:00pm - 7:30pm Meet Each Other
7:30pm - 7:45pm Welcome by Organizer
7:45pm - 9:00pm Lighting Round!
The meet up is free of charge, if you can’t get to the place and need more information, contact Aizat by email (aizat.faiz[a.t]gmail.com) or Call(017-690-8783).
Have fun!
Join irc.freenode.net #myossÂ
Posted in Open Source, Technology | No Comments »
January 11th, 2006
Only one inch thick, it packs a standard built-in iSight* camera and an innovative new magnetic power adapter called MagSafe, which eliminates costly disaster caused by tripping over power cord(it disconnects at the slightest sudden tug).
As for why the Intel transition is so exciting and so essential, Jobs explained, “We realized it wasn’t just about performance. It was about performance per watt.”
On power-per-watt performance, the Intel Core Duo processor delivers-an improvement of up to 400 percent over the G4 chip, according to Apple. Jobs also pointed out that the impressive benchmarks were achieved using Intel’s own compiler.
The MacBook Pro starts shipping in February 2006, but Jobs advised, “I suggest you get your order in early.”
Two more Intel-based Macs were highlighted on center stage during Jobs’ keynote. While the iMac’s distinctive all-in-one look was not dramatically modified from previous models, it delivers the punch of the Intel Core Duo processor and a 20-inch model with a 2.0Ghz processor.
The new iMacs are available immediately.
All new MacBook Pros ship with a remote and Apple’s FrontRow software for viewing videos, showing photos and watching videos.
Posted in Technology | No Comments »
January 3rd, 2006
Have been playing with Ajax recently, and I have did some research on it as well(during holidays).
Well, I have tried using Sajax to create a dynamic table for data editing. By using Sajax toolkit, it can be done in less than 15mins(depend on your needs).
Visit Sajax website for more information and download the source code for example.
If you have created something interesting, please leave a message here or ping back. Thank!
Posted in Javascript/Ajax | No Comments »