I would pass two php variables from a codeigniter controller to a javascript function located to the head of my view. is it possible to do such thing?
I would pass two php variables from a codeigniter controller to a javascript function
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
yeah sure, just echo the javascript:
<?php echo '<script>var myPhpVariable = "'. $my_var . '";</script>'; ?>