1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+5 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 :)

1565 posts
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

Np, good luck in work ;)

1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+5 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?

1565 posts
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

Hmm I’m not sure I understand the problem.

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

1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+5 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!

1565 posts
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 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