Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Wordpress Shortcode and number format integration

Trying to insert a Wordpress "Shortcode" and use number_format in Wordpress



5:41 am on Sep 17, 2009 (gmt 0)

10+ Year Member


I have a wordpress blog whith a search and replace plugin that inserts strings into text using a "shortcode."

I am trying to use thie number_format function to reformat the numeric strings.

For example, if my shortcode represents the number 12345 and I want it to be formatted as $12,345 I am using this code ...

$new_num = $[shortcode]
$formatted_number = number_format($new_num, , ,',');
echo ('$' . $formatted_number);

I get nothing.

What did I miss?

Thanks in advance,


11:12 am on Sep 17, 2009 (gmt 0)

10+ Year Member

$[shortcode] should probably be $variable['shortcode']; no?

Featured Threads

Hot Threads This Week

Hot Threads This Month