M Mike_Wiseman Established Member ★ 20 ★ Impact 3 Apr 27, 2007 1K views 5 replies #1 [resolved] Strings Ok i am trying to add bbcode into one of my pages and here is where im having trouble: Code: $string = "text" I want "Text" to echo the users quote in the database: Code: $string = "$fetch->quote" But i get a Parse Error Last edited: Apr 27, 2007
[resolved] Strings Ok i am trying to add bbcode into one of my pages and here is where im having trouble: Code: $string = "text" I want "Text" to echo the users quote in the database: Code: $string = "$fetch->quote" But i get a Parse Error
Barrucadu Established Member ★ 20 ★ Impact 64 Apr 27, 2007 #2 Try This: PHP: $string = $fetch->quote;
M Mike_Wiseman Established Member ★ 20 ★ Impact 3 Apr 27, 2007 #3 i did that but then i have this error: Parse error: syntax error, unexpected '=' in /home/mafiamay/public_html/a/profile.php on line 105 line 105: Code: $bb-replace = array('[b]','[/b]','[i]','[/i]');
i did that but then i have this error: Parse error: syntax error, unexpected '=' in /home/mafiamay/public_html/a/profile.php on line 105 line 105: Code: $bb-replace = array('[b]','[/b]','[i]','[/i]');
Eric VIP Member VIP ★ 20 ★ Impact 328 Apr 27, 2007 #4 Mike_Wiseman said: i did that but then i have this error: Parse error: syntax error, unexpected '=' in /home/mafiamay/public_html/a/profile.php on line 105 line 105: Code: $bb-replace = array('[b]','[/b]','[i]','[/i]'); Click to expand... PHP: $bb->replace = array('','','','');
Mike_Wiseman said: i did that but then i have this error: Parse error: syntax error, unexpected '=' in /home/mafiamay/public_html/a/profile.php on line 105 line 105: Code: $bb-replace = array('[b]','[/b]','[i]','[/i]'); Click to expand... PHP: $bb->replace = array('','','','');
M Mike_Wiseman Established Member ★ 20 ★ Impact 3 Apr 27, 2007 #5 nvm problem fixed. i just had to echo the $string
Dan Buy my domains.VIP Member VIP ★ 15 ★ Impact 108 Apr 27, 2007 #6 Also, if you are going to use a class function inside of double quotation marks, you need to enclose it in brackets. Example: PHP: <?php echo "{$fetch->quote}"; ?> (Yes, I know it's dumb to do it this way if you are only going to echo the one function/variable. It's an example. ) :gl:
Also, if you are going to use a class function inside of double quotation marks, you need to enclose it in brackets. Example: PHP: <?php echo "{$fetch->quote}"; ?> (Yes, I know it's dumb to do it this way if you are only going to echo the one function/variable. It's an example. ) :gl: