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 (Zend_Config_Xml actually) and foreach : which tag am I iterating?
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

Categories

HOME
variables
gerrit
zeromq
openstack
spagobi
read-eval-print-loop
analysis
v8
umd
ojdbc
in-app-purchase
pheatmap
kibana-4
postgres-xl
dtrace
decimal
iolanguage
beyondcompare
cx-freeze
riot.js
arabic
sylius
excel-2007
opennlp
spark-jobserver
centos6.5
status
poltergeist
user-interaction
fgetcsv
windows-error-reporting
typo3-6.2.x
elasticsearch-ruby
windows-server-2000
gsoap
madlib
skia
google-sites-2016
scorm2004
azure-sql-database
revolution-slider
stacked
simplexml
streamsets
fedex
jvm-languages
android-mediaprojection
apple-news
qwt
youcompleteme
filepicker
apache-fop
elgg
lift-json
pg-dump
flow-control
quartz-composer
background-service
pintos
angular-strap
xcb
angular-cache
httplistener
phishing
master-slave
pickadate
ios4
itextpdf
marching-cubes
atk4
libressl
angular-local-storage
pretty-print
dereference
offloading
clicktag
tablelayout
winddk
qcodo
valueconverter
srs
prettify
easy-install
jplaton
qt-faststart
interface-orientation
venn-diagram
ocx
parametric-equations
dotnethighcharts
zpt
mod-auth
hamachi
yetanotherforum
cxxtest
digest-authentication
getresponsestream
preference
castle-monorail
perfect-hash
microsoft-virtualization
temporal-database
yagni
sustainable-pace
procedural-music

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App