Jump to content

Archived

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

tomfmason

php equivalent to asp's CStr

Recommended Posts

The subject says it all. I have been searching for hours and can't find an equivalent for what I am trying to do.

Here is the asp

[code]
CASE "Other Purchases"
  NB = 0
  For i = 1 to iCount     
    Quantity = Request("Quantity" & CStr(i))
    If IsNumeric(Quantity) Then
      ARYshopping(cartItemQuantity,i) = abs(CLng(Quantity))
[/code]

The CStr function converts this variable to a subtype string.

I am at a loss on this one.

Any suggestion would be great.

Thanks,
Tom

Share this post


Link to post
Share on other sites
You don't need it. Type converion is automatic
[code]<?php
$x = 'Quantity';
$y = 1;

echo $x.$y;  // --> Quantity1
// or
echo "$x$y";  // --> Quantity1
?>
[/code]

Share this post


Link to post
Share on other sites

×

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.