Jump to content

Getting and using data from js function explode not working


Reinoud

Recommended Posts

I am able to retrieve data from a js like this:

<!DOCTYPE html>
<html>
<body>


<script>
var a=[1,2,3,4]

</script>

<?php

$ap= "<script> document.write(a) </script>";
print_r ($ap);
$b=explode(',',$ap);
print_r($b);

?> 

</body>
</html>

Result:

1,2,3,4Array ( [0] => 1,2,3,4 )

Why is the array not explode

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...