Showing posts with label PHP core. Show all posts
Showing posts with label PHP core. Show all posts

Sunday, December 23, 2012

Object-C with PHP MYSQL


1) NSURLConnection and its delegate methods - you can send asynchronous request to your webserver to get this file and get notified when the data has been downloaded so the user interface is never blocked in your app.
At the end of the download, you will have an NSData object which can then be converted back to a string using NSString *jsonContents = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding.
You can then use a JSON parser library - I recommend SBJSON https://github.com/stig/json-framework- which will parse the data and return it as a dictionary or array depending on your structure.
From there you can access your tables and value with valueForKey in dictionaries orobjectAtIndex: in arrays and then map it into your chosen local storage, for which I recommend Coredata (or you could use sqlite if you are familiar with it too).

Friday, September 21, 2012

Cộng trừ ngày tháng trong php

Xử lý ngày tháng trong PHP

Trừ ngày


$date = "2009-03-02";
$new_date = strtotime ( '-2 day' , strtotime ( $date ) ) ;
$new_date = date ( 'Y-m-j' , $new_date );
echo $new_date;


Friday, August 10, 2012

PHP User online tutorial

This tutorial show you php script that count how many users are active on your site.

Overview

In this tutorial, create 1 PHP file for testing this code.
1. user_online.php

Steps
1. Create table "user_online" in mysql in database "test".
2. Create file user_online.php.

Popular Posts