I am using WordPress WooCommerce plugin as a store management. When I echo with <?php echo $order->get_order_number(); ?> I get #6453 as a result but I need only numbers so how do I strip out # from the number?

closed as off-topic by Otto, gmazzap, Rarst Jan 12 '14 at 13:43

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should be specific to WordPress within defined scope (merely happening in its context, such as generic PHP/JS/HTML/CSS, is insufficient). Might be better asked at Stack Overflow or other appropriate site of Stack Exchange network." – Otto, gmazzap, Rarst
If this question can be reworded to fit the rules in the help center, please edit the question.


Just remove the first character of the string:

echo substr( $order->get_order_number() , 1 );

Not the answer you're looking for? Browse other questions tagged or ask your own question.