576 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
Gareth_Gillman says





On the form page, please do
var_dump( $_GET );
and tell me the output.

I get the following:

 array(1) { ["package"]=> string(20) "Graduate bronze £65" } 
Can you please paste the output of this then:
var_dump( isset( $_GET['package'] ) );
var_dump( strtok( $_GET['package'], '£' ) );
var_dump( strtok( '£' ) );
 bool(true) string(16) "Graduate silver " string(2) "75" 

Ok, then this should work:

$price = isset( $_GET['package'] ) ? intval( strtok( $_GET['package'], '£' ) ) : 0;
$price = intval( strtok( '£' ) );

Bingo! That’s brilliant, thanks so much :)

1476 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
OriginalEXE says

Np, good luck in work ;)

576 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
Gareth_Gillman says

The above code works great but found a slight glitch that hopefully is an easy fix, in Paypal I show the url as the item but it shows the following:

Graduate silver £75

Is there a way to change it to be £75?

1476 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
OriginalEXE says

Hmm I’m not sure I understand the problem.

So the problem is that it adds  to the item name?

576 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
Gareth_Gillman says

No, basically the browser is turning the £ into the A, basically because the £ hasn’t been set in the HTML character sert (£).

Is there a way with Php to change the £ to £ so it won’t get converted!

1476 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
OriginalEXE says

Well you could try something like this:

$product_name = $_GET['package']; // This is the package name, does not matter, you probably have this already

$product_name = str_replace( '£', '& #163;', $product_name ); // Replace pound sign with it's html number in product name variable

Ps in the above code remove space between “&” and ”#163”

by
by
by
by
by
by