---
title: "Hjälp med preg_match_all!"
type: "forum-thread"
url: "https://www.webforum.nu/amne/php/159573-hjälp-med-preg-match-all"
topic: "PHP"
topic_url: "https://www.webforum.nu/amne/php"
author: "salo18"
published: "2007-04-23T13:27:11.000Z"
updated: "2007-04-23T16:50:58.000Z"
replies: 1
views: 295
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/php/159573-hjälp-med-preg-match-all"
---

# Hjälp med preg_match_all!

## #1 — salo18, 2007-04-23T13:27Z

Någon som kan hjälpa mig med hur koden ser ut för preg_match_all om jag vill göra detta:

Här är en sträng:

```php
<a href='/ppc/term/digital photo print/' >
```

Delen jag vill ha ut är **digital photo print**.

Jag har försökt som en galning men tycker det är väldigt krångligt.

Permalänk: https://www.webforum.nu/p/159573

## #2 — Peter S, 2007-04-23T16:50Z

```php
preg_match('@/([^/]+)/\'\s*>@', $str, $matches);
echo $matches[1];
```

Permalänk: https://www.webforum.nu/p/1969466

---

Tråden på webben: https://www.webforum.nu/amne/php/159573-hjälp-med-preg-match-all
