0

I'm trying to post a result on user's wall using the following code

 $attachment =  array(
'name' => "#1<br>". $result[1]['name'].
"#2<br>".$result[2]['name'].
"#3<br>".$result[3]['name'].
"#4<br>".$result[4]['name'].
"#5".$result[5]['name'], 
'link' =>  FACEBOOK_CANVAS_URL,
'description' => "",
'picture'=> FACEBOOK_CANVAS_URL_SO."/",
'actions' => json_encode(array('name' => 'test','link' => FACEBOOK_CANVAS_URL)));
$results=$facebook->api('/'.$uid.'/feed', 'POST', $attachment);

I'm getting this output

#1 User1#2 User2#3 User3

But I want this output

#1 User1

#2 User2

#3 User3

I also tried \n, which didn't work as well

Has facebook disabled those tags?

Help Pls

Anurag
  • 141
  • 1
  • 3
  • 12

3 Answers3

0

facebook has obsoleted < br > tag in arrays. so it doesn't work

Anurag
  • 141
  • 1
  • 3
  • 12
-1

None of these options seem to work.

Try:

<br />

It should work like this!

EDIT:

Just in case, I assumed <br> is not working at all but I if you want a line in between you should do:

<br /><br />

EDIT:

Try this too:

</b>

Try it like this too:

<b>This should line break</b>
<b>This should line break</b>

Trufa
  • 39,971
  • 43
  • 126
  • 190
  • @Anurag: can you give me a little more context as to where you are trying to apply this code? – Trufa Apr 14 '11 at 14:48
  • i have a facebook appliaction.. this is my code to post on user's wall. – Anurag Apr 14 '11 at 14:52
  • @Anurag: I've updated my question once again, please try it too. – Trufa Apr 14 '11 at 14:58
  • @Anurag: I know it is done generally like this, and I know it's a long shot but have you tried it? I have seen several resource pointing to that, I thought it was a typo at first, but I would give it a go... see http://www.moneymakerdiscussion.com/forum/facebook/19655-fbml-guide.html for example – Trufa Apr 14 '11 at 15:40
  • Dear Mr. Down-voter, I took the trouble to, a) try to answer the question and b) strike out everything that was not working. We do agree this is not the correct answer yet, so: i) I have not given up on this question ii) the later is clarified with the strikeout. So, would you please justify you down-vote? Thank you. – Trufa Apr 15 '11 at 21:43
-1

Try This....

$attachment =  array(
'name' => "#1". $result[1]['name']."<br/>".
"#2".$result[2]['name']."<br/>".
"#3".$result[3]['name']."<br/>".
"#4".$result[4]['name']."<br/>".
"#5".$result[5]['name']."<br/>", 
'link' =>  FACEBOOK_CANVAS_URL,
'description' => "",
'picture'=> FACEBOOK_CANVAS_URL_SO."/",
'actions' => json_encode(array('name' => 'test','link' => FACEBOOK_CANVAS_URL)));
$results=$facebook->api('/'.$uid.'/feed', 'POST', $attachment);
Fero
  • 12,969
  • 46
  • 116
  • 157