jokerofsouls Posted September 20, 2008 Share Posted September 20, 2008 echo "("\ . $Type . "\",0,\"" . $Say . "\")<br />"; It prints like this (",0,"") but i want it to print like this ( ,0,"") Could someone help me Quote Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/ Share on other sites More sharing options...
DamienRoche Posted September 20, 2008 Share Posted September 20, 2008 It should be: echo "(".$type.",0,\"".$say,"\")<br />"; I think...eek Just to note, it's the first instance of \" in your line that is causing the problem. It is escaping the double quotes and so it shows when you echo. Also, there was an extra \ : echo "("\ . $Type Quote Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/#findComment-646744 Share on other sites More sharing options...
jokerofsouls Posted September 21, 2008 Author Share Posted September 21, 2008 That did not work Quote Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/#findComment-646755 Share on other sites More sharing options...
kenrbnsn Posted September 21, 2008 Share Posted September 21, 2008 Try <?php echo '(' . $Type . ',0,"' . $Say . '")'; ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/#findComment-646759 Share on other sites More sharing options...
Adam Posted September 21, 2008 Share Posted September 21, 2008 I assume it's to build a js function? I imagine you'll need quotes around $type value aswell?? Using kens code.. <?php echo '("' . $Type . '",0,"' . $Say . '")'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/#findComment-646761 Share on other sites More sharing options...
jokerofsouls Posted September 21, 2008 Author Share Posted September 21, 2008 That prints like this ("",0,"") i want it to print like this (,0,"") Quote Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/#findComment-646826 Share on other sites More sharing options...
redarrow Posted September 21, 2008 Share Posted September 21, 2008 the only way i can output your method mate............. <?php $a=0; $b=" ,$a, \"\" "; echo '("' . 2 . $b . 3 . '")'; ?> <?php $a=0; $b=" ,$a, \"\" "; $c=2; $d=3; echo '("' . $c . $b . $d . '")'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/#findComment-646830 Share on other sites More sharing options...
jokerofsouls Posted September 21, 2008 Author Share Posted September 21, 2008 I dont want the " in the beginning Quote Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/#findComment-646836 Share on other sites More sharing options...
redarrow Posted September 21, 2008 Share Posted September 21, 2008 <?php $a=0; $b=" ,$a, \"\" "; $c=2; $d=3; echo '(' . $c . $b . $d . ')'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/#findComment-646840 Share on other sites More sharing options...
jokerofsouls Posted September 21, 2008 Author Share Posted September 21, 2008 (2 ,0, "" 3) I want to be able to have a $Post in the " like this "$Post" Quote Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/#findComment-646856 Share on other sites More sharing options...
kenrbnsn Posted September 21, 2008 Share Posted September 21, 2008 Try something like this: <?php $tmp = array(2,0,'"Test"'); echo '(' . implode(', ',$tmp) . ')'; ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/#findComment-647034 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.