NameSilo

[PHP] Whats wrong here (easy one)

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
NamecheapNamecheap
Watch

w1ww

Established Member
Impact
9
Whats wrong here?:

PHP:
//array of invalid characters
  $junk = array('.' , ',' , '/' , '\' , '`' , ';' , '[' ,  ']' , '-', '_', '*', '&', '^', '%', '$', '#', '@', '!', '~', '+', '(', ')', '|', '{', '}', '<', '>', '?', ':', '"', '=');

Error:

Parse error: syntax error, unexpected '`', expecting ')'


Thank you :)
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
w1ww said:
Whats wrong here?:

PHP:
//array of invalid characters
  $junk = array('.' , ',' , '/' , '\' , '`' , ';' , '[' ,  ']' , '-', '_', '*', '&', '^', '%', '$', '#', '@', '!', '~', '+', '(', ')', '|', '{', '}', '<', '>', '?', ':', '"', '=');

Error:




Thank you :)

I don't know php but I think you have to escape special characters, So where you have '\' it should be '\\'. There are other special characters you have to escape but like I said I don't know PHP, So I don't know witch ones
 
0
Close
0
Close
Try this.

Code:
$junk = array('.' , ',' , '/' , '\'' , '`' , ';' , '[' ,  ']' , '-', '_', '*', '&', '^', '%', '$', '#', '@', '!', '~', '+', '(', ')', '|', '{', '}', '<', '>', '?', ':', '"', '=');
 
0
Close
Code:
$junk = array('.' , ',' , '/' , '\\' , '`' , ';' , '[' ,  ']' , '-', '_', '*', '&', '^', '%', '$', '#', '@', '!', '~', '+', '(', ')', '|', '{', '}', '<', '>', '?', ':', '"', '=');
You need to escape the \
 
0
Close
Thank for the help guys:)
 
0
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back