www.allfree-stuff.com


Saturday, January 29, 2011

How to Add days, weeks, months, years to dates in PHP

How to Add days, weeks, months, years to dates in PHP

As you probably know php gives you a nice date() function that allows you to get a date and format it using a vast amount of unix date strings. But what if you want to add/subtract days, weeks and months to a date?

You can add any amount of time to a date in php using the strtotime function, this will allow manipulation of a date once it has been converted to a unix time string. See the example below:

$today = date("Y-m-d");// current date
$tomorrow = strtotime(date("Y-m-d", strtotime($today)) . " +1 day");
$output = date("Y-m-d", $tomorrow);

So the first line gets todays date, then the next command gets today and converts it to a time string with the modifier +1 day. This can be days, week, month or year depending on the requirements. Then we reformat the string as a date to output it. It’s really that simple.



Sunday, January 2, 2011

Internet and Web Technologies - Multiple Choice/Objective Questions (Part 1)


1. This lightweight protocol provides a way for programs to interact with each other, even if using different operating systems and located behind a firewall.
a. CORBA
b. SOAP
c. RMI
d. DCOM

Ans :- b


2. This platform simplifies application development and decreases the need for programming and programmer training by creating standardized,reusable modular components.
a. GDMO
b. JES2
c. J2EE
d. JNDI

Ans :- c


3. What technology is being referred to as Web 3.0?
a. Open Source Technology
b. The Semantic Web
c. Read Write Web
d. Social Networking

Ans :- b


4. This method ensures that each XML element type and attribute name has a unique identity.
a. namespace
b. fully-qualified domain name
c. Multiprotocol Label Switching
d. named pipe

Ans :- a


5. This term encompasses the plans, methods, and tools aimed at modernizing, consolidating, and coordinating the computer applications in an enterprise.
a. EAI
b. EDI
c. grasping plan
d. decision support system

Ans :- a


6. This markup language is considered to be extensible because of its unlimited and self-defining markup symbols.
a. HTML
b. XHTML
c. XML
d. W3C

Ans :- c



7. This XML-based registry is intended as on online Internet registry for businesses worldwide.
a. Universal Plug and Play
b. UDDI
c. Uniform Resource Locator
d. UDF

Ans :- b


8. This application program interface (API) from Sun Microsystems supports messaging between computers in a network.
a. write once, read many
b. Short Message Service
c. Simple Mail Transfer Protocol
d. Java Message Service

Ans :- d


9. Scribd is:-
a. email client
b. blog
c. chat server
d. file sharing repository

Ans :- d


10. This XML extension is a standard way to describe how to transform the structure of an XML document into an XML document with a different structure.
a. extract, transform, load
b. tree structure
c. XSLT
d. phase change

Ans :- c


11. This is a data structure representing a service type in a Universal Description, Discovery, and Integration registry.
a. model-view-controller
b. tModel
c. Venn diagram
d. exploratory model

Ans :- b


12. When was IE8 released?
a. March 19th 2009
b. March 19th 2008
c December 10th 2008
d. January 21st 2009

Ans :- a


13. Mozilla Thunderbird is an Internet browser
a. True
b. False

Ans :- b


14. Name the founder of Wikipedia?
a. Tim Shell
b. Jimmy Wales
c. Jason Richey
d. Bomis

Ans :- b


15. This XML-based language is used to describe the services a business offers and to provide a way for individuals and other businesses to access those services electronically.
a. Xerces
b. X-Box
c. XUL
d. WSDL

Ans :- d



16. How much did News Corp. pay for MySpace?
a. $580 Million
b. $440 Million
c. $ 290 Million
d. $880 Million

Ans :- a


17. PHP stands for:-
a. Preprocess Hypertext
b. Preprocessor Hypertext
c. Hypertext Preprocessor
d. None


Ans :- c



18. What does AJAX stand for?
a. Asynchronous JavaScript & XML
b. Automatic JavaScript & XML
c. Asynchronous JavaScript & XHTML
d. Adaptive JavaScript & XML

Ans :- a


19. At which site can you just click on the word's first letter if you don't know how to spell the whole word?
a. Google
b. Yahoo! Kids
c. Kidsclick
d. Ask for Kids


Ans :- c



20. RSS stands for:-
a. Really Simple Standards
b. Really Simple Synonyms
c. Really Simple Syndication
d. Really Simple Specifications

Ans :- c

Internet and Web Technologies - Multiple Choice/Objective Questions (Part 2)


1. Who contributed the term “Hypertext”?
a. Tim Bernes Lee
b. Scott E. Fahlam
c. Ted Nelson
d. William Gibson

Ans :- c

2.
Syntax of PHP is similar to:-
a. Perl or C
b. Perl and C
c. Only C
d. Only Perl

Ans :- b

3. Google bomb is:-
a. Spam Mail
b. Shared Network
c. Successful Bloggers
d. Inflate Website’s Search Ranking

Ans :- d

4. What is not an area of study within Human Factors research?
a. Human Anatomy
b. Human performance
c. Technology design
d. Human and technology interaction

Ans :- a

5. Google was founded by:-
a. Larry Page & Sergey Brin
b. David Filo & Jerry Yang
c. Jeff Bezos
d. Shawn Fanning

Ans :- a

6. Archy is:-
a. keyboard driven UI
b. Mouse driven UI
c. Joystick driven UI
d. both a & b

Ans :- a

7. Which is the earliest social networking site?
a. classmates.com
b. orkut.com
c. facebook.com
d. None

Ans :- a

8. Modem stands for:-
a. Modulator & Demodulator
b. Memory Demagnetization
c. Monetary Devaluation Exchange Mechanism
d. Monetary Demarkation

Ans :- a


9. Which of the following interface design principles does not allow the user to remain in control of the interaction with a computer?
a. allow interaction to interruptible
b. allow interaction to be undoable
c. hide technical internals from casual users
d. only provide one defined method for accomplishing a task

Ans :- d


10. Which of the following is not a method of accessing the web?
a. ISDN
b. DSL
c. Modem
d. CPU

Ans :- d

11. The Macintosh menu bar is faster than the Windows menu bar primarily because of:
a. the power law of practice
b. task analysis
c. Fitt’s Law
d. perceptual fusion

Ans :- c

12. Two different principles widely used in GUI design are Application oriented interfaces and:-
a. Object User Interfaces
b. Object Oriented User Interfaces
c. Touch interfaces
d. Attentive User Interfaces

Ans :- b

13. Which model depicts the image of a system that an end user creates in his or her head?
a. design model
b. user model
c. system model
d. system perception

Ans :- d


14. You can load a VCR tape the right way because of:
a. physical constraints
b. logical constraints
c. semantic constraints
d. cultural constraints

Ans :- a

15. WUI stands for:-
a. Web –based User Interface
b. Web User Intelligent
c. Web Urgent Interface
d. None

Ans :- a


16. What is GOMS?
a. Goals, Operations, Module, Selection
b. Goals, Operators, Methods, Selection
c. Goals, Operating system, Methods, Selection
d. None

Ans :- b


17. JavaScript was originally called as:-
a. Java web scripting
b. LiveScript
c. HTML Jscript
d. None

Ans :- b


18. CLI stands for:
a. Class Line Interface
b. Computer Line Interface
c. Command Line Interface
d. None

Ans :- c


19. BCI stands for:-
a. Brain Chip Interface
b. Brain Computer Interconnection
c. Brain Computer Interface
d. None

Ans :- c


20. Which of the following interface design principles reduces the user's memory load?
a. define intuitive shortcuts
b. disclose information in a progressive fashion
c. establish meaningful defaults
d. provide an on-line tutorial
e. answers a, b and c

Ans :- e


21. Who is NOT involved in Human Factors research?
a. Animals
b. Scientists
c. NASA
d. Technology designers

Ans :- a


22. What is human-centered design?
a. Design of human beings
b. A term used in drawing
c. A teaching method
d. A methodology in technology design

Ans :- d


23. Which model depicts the profile of the end users of a computer system?
a. design model
b. implementation model
c. user model
d. user's model

Ans :- c


24. User Interfaces are commonly programmed using:-
a. application driven architecture
b. network driven architecture
c. event driven architecture
d. None

Ans :- c