We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question

Using perch_content for a PHP variable

Hi, I need to remove whitespace for a number hyperlink

<a href="callto:<?php $string = perch_content('Mobile'); $res = preg_replace("/[^a-zA-Z0-9]/", "", $string); echo $res; ?>"><?php perch_content('Mobile'); ?></a>

But I am not able to remove white spaces, do I need to do something with that perch variable?

Raul Serrano

Raul Serrano 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Change:

$string = perch_content('Mobile');

to

$string = perch_content('Mobile', true);

Yea! ---- :)