How to extract untagged elements with symfony dom crawler. For example in the sample html below I want to extract Hello World. titleHello WorldSub-Title
Tag: php
Retrieving variables from HTML with JSON data contained in Javascript
I have a simple HTML file that contains data I’m trying to scrape out so that I can work with the variables. Using PHP, I’m trying to parse the data contained on this HTML in to variables. I.E.: $A = 2, $B = 8, $C = 10, $D = 18, $E = 21. So far, I’ve been trying to use
Check if the index exists or not Elasticsearch
I want to check in elasticsearch if the index exists or not. If it not exists it should create the index and do other functionality. I try to find out a solution for that, but did not find any perfect solution for that. Can anyone have any solution to solve this problem. I am using Elasticsearch library. Answ…
PHP code inside a Laravel 5 blade template
I have to place some PHP code inside a Laravel 5 blade template. Like below @foreach ($farmer->tasks as $task) @if ($task->pivot->due_at) < date(now)) $style = 'alert alert-...
Can you include raw JSON in Guzzle POST Body?
This should be soo simple but I have spent hours searching for the answer and am truly stuck. I am building a basic Laravel application and am using Guzzle to replace the CURL request I am making at …
SimpleXmlElement Parsing Errors
Just had a WordPress site updated with the latest Custom Contact Forms. After the update the site is no longer loading and I see these errors: The first error refers to this function: But these errors are only PHP warnings, not fatal errors. But I get the white screen of death anyways. I am not familiar with …
Codeigniter 3 – Access Session from Outside Codeigniter Installation
I can’t seem to get session data passed from my codeigniter application back to a script in my includes folder. From what I’ve read on other answers, I need to set my session_id() to be able to rejoin a session with session_start(). Theoretically the code below should work, at least according to o…
echo “windows.open(‘view_users.php’,’_self’)”; – is not working
I’m faily new at this so please help. I’m doing and admin panel, and once I put my email and password, it doesn’t go to the page I created (view_users.php). I’m following this tutorial. Everything works until minute 15.47. This is a school project, nothing too fancy. Here is the php pa…
Sort array by keys in custom order
I have the following multidimensional array I need to sort each of the inner arrays by their key so they are in the order LOW, MEDIUM, HIGH (the first is correct by chance). I tried the following code which I took and adjusted from here: but this orders them as HIGH, MEDIUM, LOW (ascending alphabetical). It d…
Getting error when sending an email in Laravel 4.2
I have an error in Laravel when I am sending an email. I have a form with a select tag and when I select the user and click submit I need to send him a mail after I select it. Here is my …