Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Comments for: vaska20050812

Message # 1029752:
Date: 08/16/05 04:22
By: tof
Subject: easier to read

Sometimes concatenation is not the best way to have a code easy to read, mainly when it concatenates arrays. sprintf can be a solution:

You can have, for exemple :

$link = "<a href=\"" . $array["href"] . "\" title=\"" . $array["title"] . "\">" . $array["content"] . "</a>".

Easier to read is:

$link = sprintf("<a href=\"%s\" title=\"%s\">%s</a>",
$array["href"],
$array["title"],
$array["content"]);

Previous Message | Next Message


Comments:
Tip #6Per Persson09/14/05 14:22
Excellent InformationShafiq Rehman09/09/05 08:47
Part One URLVaska08/21/05 08:52
10 Tips That Every PHP Developer Should Know,Clement08/19/05 12:43
Updated the articlevaaaska08/17/05 14:28
easier to readtof08/16/05 04:22
from the editorScott08/15/05 15:22
Error in your tutJohn08/15/05 12:53
correction...Piotr08/15/05 11:44
Tip 6Scott Reynen08/15/05 09:42
correction...matt08/15/05 02:33
Very niceLogan K.08/14/05 11:22
WHAT?!Jesse08/14/05 01:28
Tip #5Toby08/13/05 17:32
Few tips Jeffery Vaska should know.root08/12/05 14:10
"hackers"martin sarsale08/12/05 11:23
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.