Using PHP, I want to be able to open a JavaScript file and take out a part of a particular line. Using the example below, I would want to remove "8:20am|8:20am" from the file, keeping everything else intact.
My JavaScript file looks like this:
var daylist = document.checkout.checkoutDay
var timelist = document.checkout.times
var times = new Array()
times[1]=["8:00am|8:00am", "8:20am|8:20am", "8:40am|8:40am", "9:00am|9:00am"]
There may be multiple lines in the Array and each with different times, so I won't know exactly where to find the string. I was thinking of maybe using str_replace() and fopen() to open the file, but without knowing what the line is going to look like ahead of time, I wouldn't know what string to replace. Any ideas?