Hello i have a simple question and i need a simple solution I have a javascript file named a pricing.js which contains this content in it var price_arr = new Array('$ 16.95','$ 30.95','$ 49.95','$ 70.95','$ 99.95','$ 109.95','$ 139.95','$ 155.95','$ 199.95','$ 460.95'); Code (markup): but i want to to update this part of javascript file using PHP so please help me in this how can i update this part of the content from javascript file using php? '$ 16.95','$ 30.95','$ 49.95','$ 70.95','$ 99.95','$ 109.95','$ 139.95','$ 155.95','$ 199.95','$ 460.95' Code (markup):
Just have a PHP script print the JavaScript and instead of linking to the .js file link to the .php (or whatever the file name is).
Its very simple just change the file name from .js to .php and change the code from JavaScript to php script..If you know php then you can easily do this....
Yes i know it but i am not an expert so thats why asking to review this suggestion if it looks like professional and easy too
Write the javascript code in your PHP file or rename the .js file to .php, then whichever part you want to replace with PHP code simply insert '<? echo $mystring; ?>' and any code you wish to include. This will work fine.