SUBBUINDESIGN Blog

Php Interview Questions and Answers -05

Why doesn’t the following code print the newline properly? <?php $str = ‘Hello, there.\nHow are you?\nThanks for visiting techpreparation’; print $str; ?> Because inside the single quotes the \n character is not interpreted as...

Php Interview Questions and Answers -04

What is the difference between ereg_replace() and eregi_replace()? eregi_replace() function is identical to ereg_replace() except that it ignores case distinction when matching alphabetic characters. How do I find out the number of parameters passed...

Php Interview Questions and Answers -03

Would I use print “$a dollars” or “{$a} dollars” to print out the amount of dollars in this example? In this example it wouldn’t matter, since the variable is all by itself, but if...

Php Interview Questions and Answers -02

How do you define a constant? Via define() directive, like define (“MYCONSTANT”, 100); What are the differences between require and include, include_once?  Anwser 1: require_once() and include_once() are both the functions to include and...

Php Interview Questions and Answers -01

What’s PHP ? The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. What...

CSS Interview Questions and Answers -06

Why call the subtended angle a “pixel”, instead of something else (e.g. “subangle”)? In most cases, a CSS pixel will be equal to a device pixel. But, as you point out, the definition of...

HTML Interview Questions and Answers -06

Can I have two or more actions in the same form? No. A form must have exactly one action. However, the server-side (e.g., CGI) program that processes your form submissions can perform any number...

CSS Interview Questions and Answers -05

How do I combine multiple sheets into one? To combine multiple/partial style sheets into one set the TITLE attribute taking one and the same value to the LINK element. The combined style will apply...

HTML Interview Questions and Answers -05

How do I align a table to the right (or left)? You can use <TABLE ALIGN=”right”> to float a table to the right. (Use ALIGN=”left” to float it to the left.) Any content that...

CSS Interview Questions and Answers -04

How do I place text over an image? To place text or image over an image you use the position property. The below exemple is supported by IE 4.0. All you have to do...

HTML Interview Questions and Answers -04

What is HTML? Answer1: HTML, or HyperText Markup Language, is a Universal language which allows an individual using special code to create web pages to be viewed on the Internet. Answer2: HTML ( H...

CSS Interview Questions and Answers -03

Why do style sheets exist? SGML (of which HTML is a derivative) was meant to be a device-independent method for conveying a document’s structural and semantic content (its meaning.) It was never meant to...

HTML Interview Questions -03

How to create nest tables within tables in HTML? We can create nest table i.e. table inside a table. To create table we use following attributes: <table>……</table>: declare starting and ending of table. <tr>…</tr>:...

CSS Interview Questions and Answers -02

Three selectors: h1, .warning and #footer, what they do ? An element points at a HTML-tag somewhere on your page. In the example above we want to style the <h1>-tag. Note that using an...

CSS Interview Questions and Answers

What is CSS? 1. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. Every element type as well as every occurrence of a specific...

HTML Interview questions -02

 11.Which of these tags are all <table> tags?   12.In HTML, inline elements are normally displayed without starting a new line.    13.How can you make a numbered list?   14.How can you make...

HTML Interview Questions -01

1. What does HTML stand for? Hyper Text Markup Language  2.Who is making the Web standards? The World Wide Web Consortium 3.Choose the correct HTML tag for the largest heading <h1> 4.What is the...

How to Get Image Information using PHP?

/* * @param string $file Filepath * @param string $query Needed information (0 = width, 1 = height, 2 = mime-type) * @return string Fileinfo */ function getImageinfo($file, $query) { if (!realpath($file)) { $file...

How to Get Users IP Address using PHP code?

Accounts for proxies: if (!empty($_SERVER[‘HTTP_CLIENT_IP’])) { $ip=$_SERVER[‘HTTP_CLIENT_IP’]; } elseif (!empty($_SERVER[‘HTTP_X_FORWARDED_FOR’])) { $ip=$_SERVER[‘HTTP_X_FORWARDED_FOR’]; } else { $ip=$_SERVER[‘REMOTE_ADDR’]; }

Partial Page Refresh

Refresh certain elements of a page using jQuery after a set amount of time, can be used with any element with an ID. I amended the example given with the URL to only refresh...

Sliding Background Links

$(‘a’, ‘#nav’).hover(function() { if(!$(this).parent().hasClass(‘current’)) { $(this).stop().animate({ backgroundPosition: ‘(0 -75px)’ }); } }, function() { if(!$(this).parent().hasClass(‘current’)) { $(this).stop().animate({ backgroundPosition: ‘(0 -0)’ }); } }); Slides up and down the background image of a link when...

Styled Popup Menu using jQuery

This idea is from Veer.com and how they handle the dropdowns for things like T-Shirt sizes. Thank you to Dennis Sa. View Demo HTML We’ll wrap a regular text input inside an <div>, which also...

Update Values of Entire Table using PHP

This code assumes you are connected to a MySQL database which has a table with Names and Emails. The idea is that it will output a table of every single value from that table,...

Truncate String by Words using PHP ?

Technique #1 <?php function trunc($phrase, $max_words) { $phrase_array = explode(‘ ‘,$phrase); if(count($phrase_array) > $max_words && $max_words > 0) $phrase = implode(‘ ‘,array_slice($phrase_array, 0, $max_words)).’…’; return $phrase; } ?> Technique #2 function limit_words($words, $limit, $append...

How to Insert a Div Tag?How to Insert a Div Tag

Hypertext Markup Language employs a number of elements used for creating different sections in a Web page to form a layout; one of them is a div tag (<div>). Div tags are used to...

How to Center a Web Page Without CSS?

Hypertext Markup Language (HTML) was created to give content providers a way to display information on the World Wide Web in a organized and structured manner. HTML’s limited ability to format and style information...

What is the Differences Between CSS & CSS3 ?

Cascading Style Sheets, known as “CSS,” is a Web design language that is used to control the look and feel of Web pages. CSS files are created separate from the Web pages during the...

The Infinite Grid

Grid systems are a key component of graphic design, but they’ve always been designed for canvases with fixed dimensions. Until now. Today we’re designing for a medium that has no fixed dimensions, a medium...

Growing Your Design Business

So you’ve launched your own creative business, and you’re starting to grow. That’s great! But good growth won’t just happen. Just like a junior designer starts with small projects and slowly builds her skills, a...