homepage Welcome to WebmasterWorld Guest from 54.226.173.169
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Wordpress Shortcode and number format integration
Trying to insert a Wordpress "Shortcode" and use number_format in Wordpress
calvinmicklefinger




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

Hi,

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 ...

<?php
$new_num = $[shortcode]
$formatted_number = number_format($new_num, , ,',');
echo ('$' . $formatted_number);
?>

I get nothing.

What did I miss?

Thanks in advance,
Kirk

 

Pico_Train




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved