I need help, at first, perhaps this is a duplicate, but I think that I’m already looking and did not find anything, as I expected and wanted.
I am confused about my problem. I wanted to convert the number format to string format,
I have a line called
$pricecode = 'ABCDEFGHIJ';
sort of:
ABCDEFGHIJ for number 1234567890
for a number from 0 to 9 and an example of the type:
$price = 1500;
so I need to replace the price and become:
AEJJ
I am trying to create code as below:
$priceCode = 'ABCDEFGHIJ';
$price = 1500;
$lenPrice = strlen($price);
$priceconveert = '';
$i=1;
$x=0;
while($i<=$lenPrice){
$number = substr($Price,$x,1);
if($number == 1){
$priceconveert .= substr($priceCode,$x,1);
}else if($number == 2){
$priceconveert .= substr($priceCode,$x,1);
}else if($number == 3){
$priceconveert .= substr($priceCode,$x,1);
}else if($number == 4){
$priceconveert .= substr($priceCode,$x,1);
}else if($number == 5){
$priceconveert .= substr($priceCode,$x,1);
}else if($number == 6){
$priceconveert .= substr($priceCode,$x,1);
}else if($number == 7){
$priceconveert .= substr($priceCode,$x,1);
}else if($number == 8){
$priceconveert .= substr($priceCode,$x,1);
}else if($number == 9){
$priceconveert .= substr($priceCode,$x,1);
}else if($number == 0){
$priceconveert .= substr($priceCode,$x,1);
}
$i++;
$x++;
}
echo $priceconveert;
With a code like a cloister, there should be a result
AEJJ
, . AEJJ, , , AEJ2, 1500 2 (00), 00 - JJ, make short J2, 15000 J3, 3 (000).
, , , , , numeric 1500 into 4 array priceCode into 10 array. .
, , , . . .