simplexml


SimpleXML extract text between two tags


I am sorry if this is a stupid question but i am new to programming. I just want to know how to extract text between two tags. For example, if i have the html below:
<div class="s1">
Hi
</div>
<div class="s2">
Hello
</div>
The expected output is to extract the #href in class s1 and the text Hi.
I know that this is easy in JavaScript with the JQuery Library. In PHP it is also possible (php jquery like selector engine)

Related Links

simplexml_load_file() error happening in only localhost/xampp
SimpleXml tar.gz
simplexml_load_file error in PHP 5.3
simplexml_load_file not a valid URI issue
Can't turn XML response into an simplexml object
Having trouble getting Fogbugz API response into a SimpleXML object
Upgraded to php 5.3.10 and simpleXMLelement is broken
Parsing RSS Feed with SimpleXML
php simplexml_load_file (script url) failed to open stream
PHP - SimpleXML not returning object
Having trouble processing XML with PHP SimpleXML
Simplexml How to access all element of the same node
simplexml_load_file failed to open stream Http request failed
Using XML node names with hyphens in PHP [duplicate]
SimpleXML Reading node with a hyphenated name
PHP simplexml Entities

Categories

HOME
atom-editor
hook
netsuite
heroku
nullpointerexception
iot
android-4.4-kitkat
cvs
packages
blueprintjs
azure-storage-tables
contact
amazon-cloudformation
applepay
rascal
qt-creator
messages
jsprit
emulator
excel-2007
telerik-reporting
microsoft-r
cas
tooltipster
windows-error-reporting
dbclient
atlassian-crucible
key-value-observing
exuberant-ctags
webtest
fusionpbx
serverside-rendering
webdriver-manager
particles.js
eclipse-scout
reportingservices-2005
ibpy
mime
modelmapper
reactive-cocoa-5
businessworks
apple-news
cubic-spline
menuitem
zip4j
veracode
brightcove
worker-thread
pg-dump
libusb-win32
dtexec
ifs
pearson
cudafy.net
spring-cache
or-tools
infix-notation
adxstudio-portals
phishing
py2app
google-web-starter-kit
yaws
system.management
thredds
ruby-2.2
citrus-pay
content-length
rgeo
dukescript
varargs
emailrelay
fluid-dynamics
census
inmobi
umbraco6
dia
gui-test-framework
mdt
googlemock
rebol3
xceed-datagrid
hyprlinkr
imdbpy
c18
oam
ccss
tidy
sharp-repository
jelly
jquery-knob
bitsharp
gil
word-processor
regsvr32
assembly-loading
ext3
photoshop-cs4
mtj
zend-decorators
geneva-server
lzh
caching-application-block
uiq3

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App