Hướng dẫn dùng currency directory trong PHP
I'll set the scene...
What I'd like is to echo the directory the file is in ie. test I've managed to do this by reading the functions and creating the script below, is this a bad way of going about this? is there an easier way?
outputs
Thanks in advance. hek2mgl 145k25 gold badges229 silver badges255 bronze badges asked Feb 13, 2013 at 17:04 1 PHP has a constant for this:
if you just want to have the last part of the path -
cryptic ツ 15k9 gold badges53 silver badges80 bronze badges answered Feb 13, 2013 at 17:08 hek2mglhek2mgl 145k25 gold badges229 silver badges255 bronze badges 1 I'd suggest you the following code:
If your PHP version is above 5.3.0, you can replace For the problems with answered Feb 13, 2013 at 17:08 RantyRanty 3,2933 gold badges21 silver badges24 bronze badges Considering this path
This also works with The 3rd combination should work for the OP.
/products/electronics/index.php
/products/electronics
electronics
index.php answered Nov 19, 2013 at 16:12 Vitim.usVitim.us 19k15 gold badges88 silver badges102 bronze badges Almost:
answered Feb 13, 2013 at 17:08 DanManDanMan 11k4 gold badges39 silver badges58 bronze badges Hàm Cú phápcurrency_format($number[, $suffix = 'đ']) Input:
Output: Dữ liệu hiển thị theo đơn vị tiền tệ được lưa chọn. Mã code
|