About PHP

  • PHP stands for PHP: Hypertext Preprocessor
  • PHP is a server-side scripting language, like ASP, that mean the scripts are executed on the server
  • A PHP scripting block always starts with <?php and ends with ?>
  • On servers with shorthand support enabled you can start a scripting block with <? and end with ?>

 

A simple example:

<html>
<body>

<?php
echo "Hello World";
?>

How to hiding the keyboard when UITextField lose focus?

//This line dismisses the keyboard.  [theTextField resignFirstResponder];

Load an image into an UIImage from a URL

download an image off the internet and add it to a UIImage object on the iPhone. 

id path = @"http://iphone.milktin.com/XXX.jpg";
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data cache:NO];

Or

NSImage *img = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:MyURL]]];

Tags: 

Comparing Two String - if statement

compare what some string text is?

if ([stringA isEqualToString: stringB])

Tags: 

Appending string to UILabel text

Try to show all text in 1 UILabel:

Label.text = [NSString stringWithFormat:@"%@ to %@", Text1, Text2];

Tags: 

Some Tips for set Directory path in IMCE - IMCE Module

  1. Create Directory path for current date:
    you can execute php to return a directory path.

    php: return 'upload/'.date('Y').'/'.date('m');
     

  2. If you has multi domain in your drupal. you may can create directory by domain:

    php: return 'upload/'.$_SERVER['HTTP_HOST'];

 

iPhone4 UI Element Size in Pixels

iPhoneUI_Height.jpg