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 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 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 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 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 . '")'; ?> 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,"") 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 . '")'; ?> 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 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 . ')'; ?> 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" 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 Link to comment https://forums.phpfreaks.com/topic/125131-need-alittle-help/#findComment-647034 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.