首页 > 解决方案 > 如何将制表符空间添加到 php 函数

问题描述

我正在尝试将选项卡空间添加到 php 函数。我尝试使用多个空格,'\t',但两者都不起作用

这是我的功能

 public function getProductDescription()
  {
    return $this->name."\t". $this->carton_quantity .' * '. $this->weight.' g';
  }

标签: php

解决方案


利用html_entity_decode()

public function getProductDescription()
{
    return html_entity_decode($this->name."    ". $this->carton_quantity .' * '. $this->weight.' g');
}

推荐阅读