hi please help me,

there is example

"thsi is paragraph A 20 .thsi in another paragraph A 40 and end now"

how can i get the value of A from paragraph it may be 1-> many in a paragraph
i want to get value of A either it may 1,2 or more than 2 in a paragraph


plshelp me sson

Use preg_match_all()

if (preg_match_all( '/A ([0-9]+)/', $paragraph, $matches, PREG_SET_ORDER )){
  foreach( $matches as $m )
    ... // process $m[1]
  }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.