On 1/11/07, Carlos A. Bonamigo <[EMAIL PROTECTED]> wrote:
I'm having troube with a script I hope someone can give me a hint on this one.
I'm trying to use this inside a script:
SDV($SearchCloudListFmt ,'
%font-size={$value}px%[[$ScriptUrl?action=search&q=$SCItem | $SCItem ]]
');
and using a foreach like this:
foreach ($SearchCloud as $SCItem=>$value){
if($SearchCloud != "" && $SCItem != "0")
$output .= $SearchCloudListFmt;
}
to fill variables inside $SearchCloudFmt , but no success so far.
What I'm missing here... Besides learning the basics. :c)
CarlosAB
Automatic variable substitution occurs in PHP inside strings within ".."
(double quotes). Once the string exists, no automatic substitutions take place.
You apparently are trying to have {$value} replaced in $SearchCloudListFmt.
Well try doing just that:
$output .= str_replace('{$value}',$value,$SearchCloudListFmt);
That should resolve your problem.
Vizinho,
/jm
ps your loop doesn't seem to make any sense. Don't you want to test on (value
!= 0), like this:
foreach ($SearchCloud as $value)
if($value)
$output .= str_replace('{$value}',$value,$SearchCloudListFmt);
_________________________________________________________________
Type your favorite song. Get a customized station. Try MSN Radio powered by
Pandora.
http://radio.msn.com
_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users