NameSilo

Strings

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

Mike_Wiseman

Established Member
Impact
3
[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:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Try This:
PHP:
$string = $fetch->quote;
 
0
Close
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]');
 
0
Close
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]');
PHP:
$bb->replace = array('','','','');
 
0
Close
nvm problem fixed.
i just had to echo the $string
 
0
Close
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:
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Each character of a domain name in its own box, with how to type one of them
Bookmarks: see bookmarks without a label
You can now show only the bookmarks you have not labeled. Open the label filter in the Bookmarks tab of your account menu, or on your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back