我希望我的 json 以 { 开头,但如果使用 json_encode 它会转换为字符串,我在 ubuntu 上使用 php7.1 并使用 magento 2.3
这就是我用下面的代码得到的,我不想要'['
[
{
"success": "true",
"data": {
"mainimages": [
{
这是我的代码
$response = array(
array(
"success" => "true",
"data" => $alldata,
"newarrivalheading" => "NEW ARRIVALS",
"instagramheading" => "CELEBS IN LULU",
"specialpriceheading" => "SPECIAL PRICES",
"editorwishlistheading" => "EDITOR'S WISHLIST",
"stylehighlightheading" => "STYLE HIGHLIGHTS",
"styletagline" => "#Looks to swipe right",
"newarrivalindex" => 3,
"instagramindex" => 9,
"editorwishlistviewall" => "",
"sliderimage" => $sliderimage
)
);
return $response;
这就是我要的
{
"success": "true",
"data": {
"mainimages": [
{