dashes ruin everything
I'm working with user submitted data from a database, and i'm having issues with what it's echoing on my page.
one's a varchar, the other is a blob. One's being echo'd with just echo, the other is nl2br, and both don't want to work if the string starts with a dash.
I've tried replacing with ndash, mdash and they still prevent the whole string from being printed.
I'm not even sure where to look for a solution, and my google-fu has failed.
help?
ETA: turns out the string is fine, it's the method I'm putting it in. basically I have
if($string > "0") {
echo $string;
} else {}
and if it's got a dash at the beginning it thinks it's > 0.
ETA 2: issue solved. My method sucked.
The right way:
if(!empty($string)) {
echo $string;
} else {}
one's a varchar, the other is a blob. One's being echo'd with just echo, the other is nl2br, and both don't want to work if the string starts with a dash.
I've tried replacing with ndash, mdash and they still prevent the whole string from being printed.
I'm not even sure where to look for a solution, and my google-fu has failed.
help?
ETA: turns out the string is fine, it's the method I'm putting it in. basically I have
if($string > "0") {
echo $string;
} else {}
and if it's got a dash at the beginning it thinks it's > 0.
ETA 2: issue solved. My method sucked.
The right way:
if(!empty($string)) {
echo $string;
} else {}
