What is the best syntax for this? I don't even know if the last part of this works.
[syntax=php]$data[0][$k]['message'] = 'You have successfully joined <a href="../c/'.$r['companytag'].'">'.$r['feedfirstname'].'</a> in '.industry($r['industry']).' at '.stage($r['stage']).' stage'.if (empty($otherfans)){"."};[/syntax]
Best Syntax
Re: Best Syntax
Well, have you tried if it works? ![Confused :?](./images/smilies/icon_e_confused.gif)
That all looks fine except for the last part. You cannot use an if statement like that.
![Confused :?](./images/smilies/icon_e_confused.gif)
That all looks fine except for the last part. You cannot use an if statement like that.
Please check out my CodeCanyon items.
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Re: Best Syntax
Tino wrote:Well, have you tried if it works?
That all looks fine except for the last part. You cannot use an if statement like that.
Yeah, the last part fails. Do you know how to properly write this?
Re: Best Syntax
You would just do
[syntax=php]$string = 'my string';
if ( empty($otherfans) ) { $string .= '.'; }[/syntax]
obviously replacing 'my string' with what you put in the first post.
[syntax=php]$string = 'my string';
if ( empty($otherfans) ) { $string .= '.'; }[/syntax]
obviously replacing 'my string' with what you put in the first post.
Please check out my CodeCanyon items.