Hi guys, it's me one more time today.
I have a PHP file echoing an array back to a javascript file.
Here's the Array being generated:
When it sends the array to the Javascript file, then I receive an error in the JavaScript error console that the "}" is missing.
What can I do, I've been using this method for many of my applications, but this is the first time that I've encountered this issue.
I've tried stripslashes, addslashes, htmlentities, etc... but nothing seems to send the entire array without receiving some kind of error.
As usual, thanks in advance :-)
I have a PHP file echoing an array back to a javascript file.
Here's the Array being generated:
Code:
$myTempArray[$count] .= "{SHOWS:\"".htmlentities($shows_new2)."\",GENDER:\"".htmlentities($gender_new2)."\",AGE:\"".htmlentities($age_new2)."\",FIRST_NAME:\"".htmlentities($user_first_name_new2)."\",LAST_NAME:\"".htmlentities($user_last_name_new2)."\",EMAIL_ADDRESS:\"".htmlentities($emailaddress_new2)."\",PHONE_NUMBER:\"".htmlentities($phone_number_new2)."\",CITY:\"".htmlentities($city_new2)."\",STATE:\"".htmlentities($state_new2)."\",ZIP:\"".htmlentities($zip_new2)."\",PICTURE:\"".htmlentities($picture_new2)."\"}";
$count++;
echo "javascript:mySeFunc([".$myTempVar."]);";
What can I do, I've been using this method for many of my applications, but this is the first time that I've encountered this issue.
I've tried stripslashes, addslashes, htmlentities, etc... but nothing seems to send the entire array without receiving some kind of error.
As usual, thanks in advance :-)
Comment