View Full Version : how to write the '-' in php items

30 Jun 2008, 5:47 AM
In the js I can write like this:

header = Ext.extend(Ext.Toolbar,{

now I can't the '-'

$head = array();
$head[] = array(
'-',///???????? how to do write this?
$head[] = array(

who can help me?

30 Jun 2008, 7:12 AM
besides this not being a php forum, i dont see why that wouldnt work...

30 Jun 2008, 1:06 PM
Look at the json_encode() of that:

You need:

Here's the code you need. Put the '-' as the first string in the array, before you make the other objects.

$head = array();
$head[] = "-";
$head[] = array("text"=>"tool1");
$head[] = "-";
$head[] = array("text"=>"menu2");

echo json_encode($head);

if I was understanding you correctly...the Javascript provided was missing a curly brace, so I'm assuming you wanted to two objects in the array...

Let me know if you need anything else.

Edit: You might need an extra set of quotes to make ext see the -'s as strings...fyi.

30 Jun 2008, 5:01 PM
Thank you very much!=D>