My site is located in https://itjmovies.com/milan/public/ and I want to rewrite the URL by .htaccess file. From https://itjmovies.com/milan/public/ To https://itjmovies.com/milan/ but it is not working. And also https://itjmovies.com/milan/public/auth/index.php?page=new To https://itjmovies.com/milan/public/a…
Modifying DOM once causes subsequent modifications to error
I’m trying to wrap all instances of certain phrases in a <span> using PHP’s DOMDocument and XPath. I’ve based my logic off of this answer from another post, but this is only allowing me to select the first match within a node, when I need to select all matches. Once I modify the DOM fo…
problem with metadata of multiple audio files using laravel
I’m creating a music player using Laravel. I’m trying to implement ‘laravel-getid3’ package into my project. Here is my code which processes the file and uploads it to the database This code can handle multiple files but is very limited i.e. can only gather a limited amount of info fro…
How to scale the number of form fields based on user input?
I’m new to PHP and making a website to add an arbitrary number of values in a given base. How would I generate several fields based on a user’s input in a previous field? Answer The simple code without any validation will be like this:
Referencing the id value from array and placing in a variable
I’m using CodeIgniter and I have a value that is being passed in my URL when I visit a page. The value that is passed is a string value, and there is an id that corresponds to that string in my database. Now I have a query in my model class that computes the string and returns it’s respective id.
PHP file handling read and write
I am trying to figure out how the file handling works, the thread says: Your task is to write a PHP script, which reads grades from the file “grades.txt”, raises all of them by one, writes the raised grades into the file “results.txt”, and finally prints the raised grades from the file…
Trying to learn php with html but I am having trouble submitting a form with a variable that is given by some javascript?
In the Html code below I grab the Ip address of the client and display it to them. I am still learning Javascript however and I am very confused with the line “$(“#gfg”).html(data.ip);” How would you rewrite this line to be more understandable? Additionally within the html file I would…
Foreach last item gets methode
Guys I have an array with objects, I want the last item in the foreach loop do something else then the rest. How do I archive that? Answer This will process the array of objects and do something else with the last element:
How to remove HTML tags as well as HTML content within a string in PHP?
I have a .txt file. Using the following code I read it: Now from the retrieved string I want to remove not only the HTML tags but also the HTML content inside. Found many solutions to remove the tags but not both – tags + content. Sample string – Hey my name is <b>John</b>. I am a <…
How can I start a WSL-based Linux executable from within PHP on Windows and capture its stdout?
I have a program that only works on Linux, and I have my development environment on Windows. When I run a WSL command from cmd in Windows it works as expected. When I run C:wsl echo “foo” in cmd.exe I get foo back via stdout. When I run the same command from within php via exec I don’t get a…