rightchoice2c_me's blog

Some Cool PHP Tricks

Some Cool PHP Tricks

1. Use PHP Echo like a Function
I've always thought that if you wanted to concatenate strings with echo, you needed to use periods. But you can actually treat echo like a function and use commas instead (it is also faster). Take a look at the following code:

<?php
$string1 = 'test-string1';
$string2 = 'test-string2';
$string3 = 'test-string3';

echo 'String #1: ', $string1, '<br />';
echo 'String #2: ', $string2, '<br />';
echo 'String #3: ', $string3, '<br />';
?>

2. Use Single Quotes When Possible

Slide show using jQuery

Slide show using jQuery

ARE YOU READY TO GET INTO THE CODE?
1) create a css file and named it style.css and add the below styles in that and save it.

#demo { padding: 20px; }

#title { font-size: 10px; font-family: Verdana, Helvetica, Arial, sans; }

a#prev, a#next { font-size: 14px; font-family: Verdana, Helvetica, Arial, sans; color: #000; text-decoration: none; }
a#prev:hover, a#next:hover {text-decoration: underline; }

.pics {
height: 222px;
width: 222px;
padding: 0;
margin: 0;
}

.pics img {
padding: 15px;

 

Free Web Hosting
v>