Skip to content

Tag: php

simple-html-dom get table id by class name

I’am trying to build a scraper using simple-html-dom. Each tr has the class “event-listing” as well as a unique id. Everything is working but I cannot figure out how to get and store the id’s. Here’s my code: Answer You don’t need anything special $event->id would work j…

symfony2 get command line executed

I am creating a console command in symfony2. I need to log an executed line i run. How to get that line? So if i run: I want to get value “php app/console my-command fileName.txt –myoption=100” Thanks for any help Answer I’m interpreting the question as: Within the Command code itself,…

Git WebHook will not pull (PHP)

I have a PHP file, hook.php, that looks like this: <?php `cd .. && git pull`; The file is located in /var/www/oliverash.me/site/. However, the git repository that needs to be pulled is /var/www/oliverash.me/. ./site is the folder Apache looks to as the document root. When I run the file in my brows…

get the input box ‘name’ using javascript

I am making form in PHP and submitting using javascript. I want to get the name of input box, As normal coding gives the value of the input box, but i need to get name of input box. Without onclick functionality on it. Can it possible that retrieving the name of input box in other javascript function on click…

PHP Latitude Longitude to Address

I have a form on my website where a user enters an address of a place. When they submit the form, I convert this location into latitude/longitude and store this in a MySQL Database. I am using Google’s Geocode service for this conversion. The problem is that I can’t find either a class or a servic…

How to bulk insert with RedBeanPhp?

I was hoping for an example on how to bulk insert new “beans” in readbeanphp without looping over each instance. It shows an example creating and saving a beans here: http://redbeanphp.com/manual/…