Author Archives: shofiur

Ajax

Ajax  shorthand for “Asynchronous JavaScript and XML,” is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user requests a change. This is intended to increase the web page’s interactivity, speed, and usability.


MooTools

MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.


JSON with PHP

Json is too much easy with php There is no installation needed to use these functions; they are part of the PHP core. nothing more need to know just only use { ,[ and create json format string and use three php function json_encode() to get JSON representation of a value, json_decode() for Decodes a JSON string, ¦json_last_error() to get the last error occurred in process.

write your desire string in below format and use php funtions :

$string='{
"firstName": "Sonia",
"lastName": "Singh",
"age": 26,
"address": {
"streetAddress": "Mira Road Thane ",
"city": "Mumbai",
"state": "maharshtra",
"postalCode": "401107"
},
"phoneNumber": [
{ "type": "home", "number": "022 333-1234" },
{ "type": "fax", "number": "022 444-4567" }
]
}’;

$decodeString = json_decode($string);
echo ‘First Name – ‘.$decode->{“firstName”};
echo ‘Last Name – ‘.$decode->{“lastName”};
echo ‘Address – ‘.$decode->{“address”}->{“streetAddress”};

Out put : Print below

First Name – Sonia
Last Name – Singh
Address – Mira Road Thane


JSON

JSON (JavaScript Object Notation) is a lightweight data-interchange format. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.

JSON is built on two structures:

  • A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
  • An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.

The JSON format is often used for serializing and transmitting structured data over a network connection. It is primarily used to transmit data between a server and web application, serving as an alternative to XML.


Design Pattern

What is a Design Pattern

A Design Pattern is a template, structure or framework on which you can build your application code. When the term Framework is used with regard to PHP, most individuals straight away consider MVC, and indeed, MVC is just one of many design patterns.

Model View Controller (MVC)

Many people are using Frameworks that implement MVC or an MVC variation.

The MVC design pattern is based on the principle of separating business logic (Model) and presentation logic (View). The idea that changes to the view, or presentation layer, should not interfere with the Model. Also, that changes to the Model, or changes to the data, should not interfere with the presentation (View).

By introducing a third party intermediatory object (Controller), the Model and View can be independent of each other. The Controller handles input from the user interface (View) and passes this information to the Model. If the Model needs to respond, the Controller takes this response and supplies it to the View.

This separation of business logic and presentation logic gives application developers wider flexibility and promotes code reuse.

More details http://www.phpro.org/tutorials/Model-View-Controller-MVC.html


Youtube video by post tag

I developed a small wordpress plugin. This plugin search youtube video with respect to post tag and add the video underneath the post description.


Follow

Get every new post delivered to your Inbox.