I would like to store a modx tag in a varible and get the correct info
for example
The Site Name is "Garage Doors Phoenix" which is 20 characters long
<?php
$snCount = strlen(’[(site_name)]’);
echo $snCount;
?>
This echoes a String Length of 13. But when I echo the ’[(site_name)]’ it displays "Garage Doors Phoenix".
if I echo substr(’[(site_name)]’, 0, 5); it returns [(sit
what I want to do is just echo the city name from it.
So I do not know what I am doing wrong.
Use $this->config[’site_name’]
Instead of [(site_name)] try
$modx->config['site_name']
// LOL It took me an hour to finally answer and @cipa beat me to it.