Can't get str_replace() to strip out spaces in a PHP string

前端 未结 7 1007
谎友^
谎友^ 2020-12-14 23:54

Hi, I am getting a PHP string which I need to strip the spaces out of. I have used the following code but when I echo $classname it just displays the string sti

相关标签:
7条回答
  • 2020-12-15 00:24

    The issue was the field that it was pulling, not the rest of the php. 'the_sub_field('venue_title')' pulls a field from the wordpress plugin 'Advanced Custom Fields' but this function is intended to display the data rather than just retrieve it. Instead i used 'get_sub_field('venue_title')' and it worked. cheers for the help

    0 讨论(0)
提交回复
热议问题