Jump to content

Recommended Posts

I am bit confused here, I got a print line in my code which is giving me errors

 

print "<a href=\"moreinfo.php?title=$ID\" class="results">";

 

does not work but same thing out of php does...

eg.

 

<a href="link.php" class="classname">linkname</a>

 

Can anyone explain? Been googling for awhile but haven't found anything...

Link to comment
https://forums.phpfreaks.com/topic/111767-solved-printing-link-with-class-problem/
Share on other sites

I really don't see the value of those functions. You have a huge block of code with multiple references to a variable and what..seriously, nothin' ctrl+f and replace couldn't handle.  I think it makes coding less readable.  I mean, to me, it like, takes away the point of naming variables something meaningful.  IMO.

OMG I HAVE 2K POSTS.  :D  Yay.

 

Anyway.  It allows for less escaping and matching of quotation marks and concatenation operators and all that stuff.  It makes code much more readable, at least the long strings with a lot of variables or HTML...

yeah i guesso...if you're using extremely long variable names...but if you're at that point then imo you probably need to look into namespaces or at least using better names...

 

I'll concede to less quotes but you can completely code without having to escape quotes if you make use of single quotes inside double quotes and use { }'s around your vars as necessary.  imo that's much cleaner and conforms more to coding standards.  I put that in the same class as not using quotes around attributes in html.  it "technically" works but is not the standard. 

 

bottom line is imo printf and sprintf promotes laziness. 

 

p.s.- gratz on 2k

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.