Jump to content

How to echo regex


jagoan-neon

Recommended Posts

I want to extract a number + last 2 digit

 

for example 23.72233113213

The result is 23.72

 

$order = 10000;

$rp = 9500;

$pay_pal = $order / $rp;

$pay_pal = $pay_pal + ($pay_pal * 0.034) + 0.3;

$pay_pal = preg_match("/[0-9]+\.[0-9]{2}/",$pay_pal);

 

How to display $pay_pal ? Try to echo it but doesn't works.

 

Thank you.

Link to comment
https://forums.phpfreaks.com/topic/190433-how-to-echo-regex/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.