unemployment Posted June 26, 2011 Share Posted June 26, 2011 Hmm I can't seem to get the quotes right or something. Please help. echo "<a href="../'.(($r['accounttyperaw'] == '') ? 'c' : 'u').'/'.(($r['accounttyperaw'] == '') ? $r['companytag'] : $r['feedusername']).'">'.ucwords($r['feedfirstname'].' '.$r['feedlastname']).'</a> has updated "; Quote Link to comment https://forums.phpfreaks.com/topic/240451-syntax-fails/ Share on other sites More sharing options...
cs.punk Posted June 26, 2011 Share Posted June 26, 2011 Dude that's a terrible line of code to read? Why not use full IF blocks? Quote Link to comment https://forums.phpfreaks.com/topic/240451-syntax-fails/#findComment-1235049 Share on other sites More sharing options...
unemployment Posted June 26, 2011 Author Share Posted June 26, 2011 Dude that's a terrible line of code to read? Why not use full IF blocks? I suppose I could, but I just wanted it condensed. Quote Link to comment https://forums.phpfreaks.com/topic/240451-syntax-fails/#findComment-1235050 Share on other sites More sharing options...
cs.punk Posted June 26, 2011 Share Posted June 26, 2011 Dude that's a terrible line of code to read? Why not use full IF blocks? I suppose I could, but I just wanted it condensed. Well your having troubles with the quotes... So why not make it easier to read for yourself? Quote Link to comment https://forums.phpfreaks.com/topic/240451-syntax-fails/#findComment-1235051 Share on other sites More sharing options...
EdwinPaul Posted June 26, 2011 Share Posted June 26, 2011 ...with something like: <?php echo "<a href=\""; if($r['accounttyperaw'] == ''){ echo 'c/'.$r['companytag']; }else{ echo 'u/'.$r['feedusername']; } echo '\">'; echo ucwords($r['feedfirstname'].' '.$r['feedlastname']).'</a> has updated '; ?> Quote Link to comment https://forums.phpfreaks.com/topic/240451-syntax-fails/#findComment-1235054 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.